9 ms·
> The repl driven workflow is amazing and the lisp images are rock solid and highly performant. do people not realize that basically everything vm/interpreted
by mathisfun123 3y ago
> The repl driven workflow is amazing and the lisp images are rock solid and highly performant.
do people not realize that basically everything vm/interpreted language has a repl these days?
https://www.digitalocean.com/community/tutorials/java-repl-jshell https://www.digitalocean.com/community/tutorials/java-repl-j...
https://github.com/waf/CSharpRepl https://github.com/waf/CSharpRepl
https://pub.dev/packages/interactive https://pub.dev/packages/interactive
not to mention ruby, python, php, lua
hell even c++ has a janky repl https://github.com/root-project/cling https://github.com/root-project/cling
edit: i get downvoted by the lisp crowd every time i bring up that the repl isn't a differentiating feature anymore :shrug:
- rfrey 3y agoThe repls you mention are not like lisp repls. You're being downvoted because your comment makes it sound like you've never programmed a lisp but have strong opinions nonetheless.
- mathisfun123 3y ago>you've never programmed a lisp but have strong opinions nonetheless i've written racket and clojure (and mathematica, which is a lisp). not multiple 10kloc but enough to understand what the big ideas are. claiming i just haven't written enough lisp is basically the logical fallacy of assuming the premise.
- behnamoh 3y ago> “mathematica is a lisp”
- mathisfun123 3y agohttp://xahlee.info/M/lisp_root_of_wolfram_lang.html http://xahlee.info/M/lisp_root_of_wolfram_lang.html http://xahlee.info/M/lisp_vs_WolframLang.html http://xahlee.info/M/lisp_vs_WolframLang.html > WolframLang has all the characteristics of LISP: seems you either don't know what lisp is or you've never written mathematica
- behnamoh 3y ago> "seems you either don't know what lisp or you've never written mathematica" Meanwhile, you brought up examples from Mathematica docs that talk about head/tails (car/cdr) but by that logic, Python is a Lisp too because you have: list[0] and list[1:] Maybe your Clojure/Racket experience wasn't enough to teach you what the essence of Lisp was. From your first link: "Mathematica expressions are in many respects like LISP lists. In Mathematica, however, expressions are the lowest-level objects accessible to the user. LISP allows you to go below lists, and access the binary trees from which they are built." That right there is telling you that Mathematica is not a Lisp. Edit: Corrected the Python list example.
- mathisfun123 3y agoI'm sorry but are you really going to pretend like car and cdr are not core to lisp? >list[0] and list[-1] That is not car and cdr; closer would be list[0] and list[1:] if lists were cons in python. >Mathematica expressions are in many respects like LISP lists. In Mathematica, however, expressions are the lowest-level objects accessible to the user. LISP allows you to go below lists, and access the binary trees from which they are built This is a quote from 1986. I wonder if the language has changed much since then https://reference.wolfram.com/language/tutorial/Expressions.html#14609 https://reference.wolfram.com/language/tutorial/Expressions....
- behnamoh 3y agoRead PG's "Roots of Lisp" and you'll understand what I mean.
- mathisfun123 3y agoI believe that is an argument from authority (if I remember correctly).
- lispm 3y agoThe content on the pages clearly explain the differences. Mathematica is a symbolic language based on 'rewriting' There are other examples - Prolog would be an example, a logic language. Also most other computer algebra systems are in this category, similar to Mathematica: Macsyma/Maxima, Axiom, ... > WolframLang has all the characteristics of LISP It has many, but there are a lot of differences, too. The big difference is the actual engine. Mathematica is based on a 'rewrite system'. It translates expressions by applying rewrite rules. Lisp evaluates expressions either based on an interpreted evaluator or by evaluating compiled code. Lisp has macros, but those can be transformed before the code is compiled or running. The practical effect is that in many Lisp implementations usually all code is compiled, incl. user code. Mathematica uses C++ then. Most of the UI in Mathematica is implemented in C++, where many Lisp systems would implement that in native compiled Lisp. Thus the computation is very different. Using a rewrite system for programming is quite clunky and inefficient under the hood. A simple example would be to look how lexical closures are implemented. Another difference is that Mathematica does not expose the data representation of programs to the user all the time, where Lisp programs are also on the surface written as s-expressions (aka symbolic expressions) in text. The linked page from the Mathematica book also claims that Mathematica is a higher level language. Which is true. Lisp is lower level and languages like the Wolfram Language can be implemented in it. That's one of its original purposes: it's an implementation language for other ('higher-level') languages. Sometimes it already comes with embedded higher-level languages. CLOS + MOP (the meta-object protocol) would be an example for that.
- patterns 3y agoBut Racket and Clojure are very different from Lisps such as Common Lisp that embrace the idea of a lively, malleable and explorable environment, which is arguably the biggest idea.
- bbbobbb 3y agoNot the OP but would somebody be able to summarize HOW are the lisp REPLs different then to me? I've written limited amount of clojure and common lisp just to play around and I don't recall any difference between Clojure REPL and the REPL I get for say Kotlin inside IntelliJ idea. Maybe the ability to send expression from the IDE into the REPL with one keybind but I cannot say it's not possible with the Kotlin one right now because that's not what I use it for.
- mathisfun123 3y agoThere's a person above saying that it's about being to able to mutate program state from the repl, which is a thing that's also possible in any repl for a language with managed memory.
- ohyes 3y agoCl Condition system + repl = godmode. Your software crashes? Do you go back and set a breakpoint? No, because you’re already in the stacktrace in the repl exactly where the crash occurred. You fix the code, reload it, tell it to ether run where it left off, or restart from an earlier point.
- mathisfun123 3y agoFlask and Django have the exact same functionality - I've already said that this thing you guys keep talking is just a matter catching exceptions. https://flask.palletsprojects.com/en/2.3.x/debugging/ https://flask.palletsprojects.com/en/2.3.x/debugging/ https://docs.djangoproject.com/en/dev/ref/settings/#debug https://docs.djangoproject.com/en/dev/ref/settings/#debug
- MarceColl 3y agoexceptions unwind the stack in all languages I know except in CL
- 3y ago
- xbpx 3y agoA REPL isn't just a REPL. You are comparing modern day Toyota Corollas to a Spaceship sent from the future to the 80s. One is just different level radical. At least when it's baked by SLY or SLIME
- mathisfun123 3y agohere is the list of slime features on the slime webpage >Code evaluation, compilation, and macroexpansion. >Online documentation (describe, apropos, hyperspec). >Definition finding (aka Meta-Point aka M-.). >Symbol and package name completion. >Automatic macro indentation based on &body. >Cross-reference interface (WHO-CALLS, etc). https://slime.common-lisp.dev/ https://slime.common-lisp.dev/ and i'm still wondering which of these things i can't do in a python repl? note macroexpansion doesn't count because that's not a dimension of the repl.
- CraigJPerry 3y ago>Code evaluation, compilation I couldn’t debug the following in pycharm and add the missing function at runtime, or could i? def interactively_writing_code(): this_doesnt_exist_yet() interactively_writing_code() I don’t think i can patch a function at runtime without losing state either in python - the act of redefining the function causes the variables to be reset but in lisp the bindings are untouched.
- mathisfun123 3y agoI just did it - it works perfectly fine. Debug-run your code, an exception will be thrown at the call site, step up one frame from the exception (ie module level), define the missing function, call again and it succeeds - all without leaving the same repl instance. Don't believe me? Try it. I'll say it again: you guys are in plain denial not about python or lisp as languages but about how interpreters work. There's just nothing more to be said about this dimension of it.
- yaantc 3y ago
- Calamitous 3y ago> i get downvoted by the lisp crowd every time i bring up that the repl isn't a differentiating feature anymore I’d suggest it has more to do with tone than content.
- memefrog 3y agoOf course people "realise" this. But those REPLs are not actually REPLs. They are interactive language prompts. They aren't actually REPLs. As the joke goes, Python doesn't have a REPL: it lacks READ, EVAL, PRINT and LOOP. Being able to type in code and have it evaluated one line at a time isn't a REPL.
- mathisfun123 3y agoi have no idea what subtle or nuanced distinction you're trying to strike so what exactly do you imagine is the difference between a lisp repl and a python repl? Edit: people that aren't familiar with python (or how interpreters work in general) don't seem to understand that being able to poke and prod the runtime is entirely a function of the runtime, not the language. In cpython you can absolutely do anything you want to the program state, all the way up to, and including, manually push/pop from the interpreter's value stack (to say nothing of moving up and down the frame stack), mutating owned data, redefining functions, classes, modules, etc. You can even, again at runtime, parse, to AST, and compile source to get macro-like functionally. It's not as clean as in lisp but it 100% gets the job done.
- LispSporks22 3y agoIn TFA, go to the “Try this in your favorite repl”, try that in your “repl” and that would be the fine distinction you’re missing.
- mathisfun123 3y ago>The answer to that question is the differentiating point of repl-driven programming. In an old-fashioned Lisp or Smalltalk environment, the break in foo drops you into a breakloop. do you want me to show you how to do this in a python repl? it's literally just breaking on exception...
- deleted 3y ago[deleted]
- deleted 3y ago