Live data from Hacker News

Mancy: JavaScript REPL

mancy-re.pl

21–25 of 25 posts

Re: Mancy: JavaScript REPL

#21

I was just looking for something like this. How do I load external node modules into the repl? I tried "File->Add module path" but it didn't seem to work for me. Basically, having done an npm install of lodash somewhere, I want to do var _ = require('lodash'); in the repl.

I did the same thing and pointed to a node_modules folder on a project I had. Worked fine for me.

Re: Mancy: JavaScript REPL

#22
post #11

Earlier quoted context omitted.

400MB of RAM for a REPL!? That's absurdly high.

The REPL is currently using 20 MB of RAM on my computer, so I don't know what this guy is talking about.

Electron consumes 117MB, npm takes 50MB, and gulp is consuming 114MB, although I don't know how much of this value is shared between the processes (since there are 40+ of them).

Re: Mancy: JavaScript REPL

#23
post #12

Earlier quoted context omitted.

> If every package was 40 MB on my computer, my distribution would be 30 GB. Only if you had installed 750 userland programs. Which are quite a lot. And even then, 30GB for your OS + your third party programs is negligible in even a 265GB flask disk (merely 12% of it). > More importantly, these 40 MB of code and resources expand to about 400 MB in memory when the application is running, but a global library wouldn't…

You are correct that code doesn't "expand on memory" but there is no fixed relationship between code size and memory usage. You could certainly write a tiny program that uses a ton of memory pretty easily.

Yeah, I say that: "a trivial 5 line program that just mallocs can use TB of memory".

Re: Mancy: JavaScript REPL

#24
autocompletion is buggy: I wrote:

var fs = require('fs');

then pressed enter. Result:

var fs = require('fs');fs

(fs in the end).

And autocompletion is too agressive. I declared variable `b`` then in new line I entered: `b` and it automatically autocompleted me to `break`.

So I think it's pretty alpha right now, but overall idea is good :) We need better tools :)

Post reply on HN