Hacker News new | ask | show | jobs
by comex 4441 days ago
One note:

> Racket's default IDE is better than GHCi and probably on par with Emacs (you almost certainly can configure Emacs to be better than anything, but it's not trivial and people don't bother, while DrRacket provides autocompletion and documentation out of the box).

Last I used it (a few years ago), DrRacket was very laggy, so I would find it very hard to use for a serious project. YMMV, maybe it's improved.

6 comments

I remember DrScheme as it was called before, it was snappy even on old amd duron boxes. DrRacket is very heavy. As other suggested, emacs+geiser gets you quite far. Maybe less nood friendly, because well emacs, no fancy gui artefacts (arrows and such).
Try the Geiser plugin for Emacs. It allows you to connect to the Racket REPL (either it starts a new instance of Racket, or it can connect to a socket/port).

I'm a Vim user and went through elaborate pains to get Emacs working almost like Vim just so I could go through SICP this way.

Could you please outline your final setup besides using Geiser? I also come from Vim-land, have almost zero experience with Emacs and already understood that, to learn SICP, setting up and learning Emacs is going to be easier than setting up Vim for the task.
Well, I'd suggest if you know nothing about Emacs to install Emacs Prelude: https://github.com/bbatsov/prelude

Next, enable the lisp/scheme modules in prelude-modules.el [1]. You need the Evil plugin to get Vim modal editing and probably Evil Leader (so you get Vim style <leader> commands).

You can look at my config [2], there's nothing really funny except I map Ctrl-H to backspace and Ctrl-[ to ESC as that's what I also use in my Vim. There's also a slight modification to make Smartparens make parenthesis highlighting behave like in Vim.

One other thing is if you're in insert mode then Emacs keystrokes should also work (Ctrl-Z to force switching between Vim/Emacs keystrokes).

If you install the SICP plugin for Emacs (it's in my custom.el) and you type M-x info-display-manual sicp, or if you have Evil installed you can use use Vim's command :info-display-manual sicp, you'll get the SICP book as a manual inside Emacs.

[1] https://github.com/humana/dotfiles/blob/master/emacs/prelude... [2] https://github.com/humana/dotfiles/blob/master/emacs/persona...

Wow, thank you very much for your suggestions and the .els! I guess now I'm really out of excuses not to start with SICP.
I find DrRacket sufficiently fast and sufficiently frustrating.

It's very useful for interactive debugging but dependent on the mouse and many Emacs key combinations simply cannot be mapped because of it's CUA interface...and so far as I can tell there is no key-combination that switches focus between the REPL pane and the Editor pane short of closing the other pane.

The syntax analysis gets to be a bit much too.

On the other hand, that's just the price of an IDE over a text editor, and for a batteries included IDE, it's pretty good even if I wish that the effort would have been put into Emacs support while knowing that doing so would not meet the needs of the PLT group's target audience of students.

by default ctrl+f6 will switch focus. You can remap that to something more convenient though (it's called shift-focus).
I think you can switch panes with C-x C-o, same as the Emacs combo.
That's C-x o; C-x C-o in Emacs runs delete-blank-lines, and I'm not sure what it does in DrRacket.
Yeah DrRacket is fairly slow unless you have a powerful computer. I recommend just using a text editor and making use of XREPL, see: http://docs.racket-lang.org/xrepl/index.html?q=

tl;dr, open up the normal repl by typing "racket" and then type (require xrepl) and then ,install! (leading comma denotes an xrepl command).

Then when you want to interact with a file you can do racket -i $file to interact with it using xrepl.

If you're wondering why this isn't just the default, I think it has to do with the readline license.

     racket -il xrepl
Will launch Racket with already xrepl loaded.
I love Racket but I have only ever had the same experience with DrRacket. I don't know what it is trying to do, but it brings my modest laptop to its knees.
Interesting... I've never had any problems with DrRacket. What qualifies as a "modest laptop"?
I actually found DrRacket very fast and Emacs very slow, on every computer I've tried them on. Why might this be?
Emacs Lisp is interpreted (or byte-interpreted), and (GNU) Emacs is written almost exclusively in it, so startup can be dog-slow. Once it's up and running, though, I've always found it pretty snappy.