4 ms·
Show HN: ReplPad – Javascript Repl/Scratchpad
- amadeuspagel 6y agoA few hours ago I was doing "repl driven development", meaning that I experimented with the repl, closed it by mistake (confusing Ctrl+D and Ctrl+C), tried to get the state I had before back using the up key, copied the history file into the project folder, removed everything unnecessary and pasted it into the repl again, and then kept developing by editing that file and pasting the result into the repl. I felt that this can't be it and made this as a demo of what I think a repl should be like.
- deleted 6y ago[deleted]
- elwell 6y agoAlbeit in Clojure/Script, the Emacs + Cider experience is quite good, and I'm never using the REPL directly from CLI, I'm editing a file and sending forms to REPL that get eval'd inline. I wrote that sentence really backwards, sorry, I'm tired.
- deleted 6y ago[deleted]
- ahelwer 6y agoWhat programming language is this? Is it available as some kind of framework for spinning up your own REPL website for your own language?
- gregsadetsky 6y agoIt's JavaScript. The REPL's code is evaluated by the page's JavaScript -- look directly in the page's source, there's an 'eval' call that evaluates the REPL's code.
- jedimastert 6y agoLooks like it's just directly `eval`ing vanilla JS
- amadeuspagel 6y agoIt's javascript. It's not available as a framework, but you can make your own repl website based on the code[1]. Though of course it would be much harder for another language, since you can't use eval(). [1]: https://gitlab.com/amadeuspagel/replpad https://gitlab.com/amadeuspagel/replpad
- jedimastert 6y agoThis is pretty fun. Reminds me of a bookmarklet I have somewhere that makes a self-editable webpage. The only suggestion I have would be to make the right textarea non-editable, although I don't know how to do so while keeping selectability
- amadeuspagel 6y agoDone. It actually keeps selectability by default, at least in chrome and firefox.
- kickopotomus 6y agoThis is a neat little project and all but what is the value proposition? The JS console of any modern browser is much more feature-full.
- amadeuspagel 6y agoIn your browser console, can you edit a previous statement and have everything recalculate?
- SamBam 6y agoType `square(10)` on the last line. Notice it doesn't give you the correct value. Fix the square function to correctly return `n*n`. Everything updates instantly. There's your answer. It's actually really neat to code that way, especially with a long chain of logic.
- macintux 6y agoI do think a comment/title/something that uses the word "Javascript" would be helpful; I guessed it was so, but there's very little syntax here and I look at JS code about once a year on average. Very cool, bookmarked.
- amadeuspagel 6y agoThanks, added javascript to the title.
- orliesaurus 6y agoInspired by repl.it by any chance? I am a heavy user of repl.it...
- mNovak 6y agoThis is fun. I'd really like to see an easy js scripting environment for slightly more complex logic. Though I suppose this accomplishes that since everything is reevaluated upon editing. FYI If I highlight everything and delete, the right-hand side 'answers' remain there, with no text to the left
- halfmatthalfcat 6y agoAlso shoutout to https://jsconsole.com/ https://jsconsole.com/ if you want a lightweight console-like experience in a browser tab.
- dandanua 6y agoThis is basically a very light version of a reactive notebook like this one https://observablehq.com/demo https://observablehq.com/demo