Readit News logoReadit News
mishoo commented on Web Embeddable Common Lisp   turtleware.eu/static/past... · Posted by u/todsacerdoti
jinlisp · 2 months ago
Both slip and jscl takes the same time in my computer: 63 seconds to run the loop.
mishoo · 2 months ago
I can see what happens there in JSCL.. I took a look at

    (disassemble (lambda () (loop for i below (expt 10 8) count t)))
Seems TAGBODY is compiled into a while(true) which sets an exception handler on each iteration. (and then, LOOP macroexpands into a TAGBODY). I don't think there's a better way to do it, BTW — JS is simply not a friendly compilation target. But `try` on each iteration is quite costly, that's most probably the bottleneck here.

mishoo commented on Web Embeddable Common Lisp   turtleware.eu/static/past... · Posted by u/todsacerdoti
feeley · 2 months ago
Related:

The Gambit Scheme REPL that comes with a tutorial, supports threads in the browser and has a JS FFI: https://try.gambitscheme.org

Gambit in emacs in the browser: https://feeley.github.io/gambit-in-emacs-in-the-browser/

mishoo · 2 months ago
Hey, nice to see Ymacs is still used somewhere else than on my website :)

I don't know if you've been tracking it lately, but there was a big overhaul last year [1]. The version in your second link doesn't seem to work in current Firefox. If you'd like to update and need any help, please feel free to get in touch. (also, there's still some of your code in Ymacs :) although I kinda broke filename completion...)

[1] https://lisperator.net/blog/ymacs-reloaded/

mishoo commented on Web Embeddable Common Lisp   turtleware.eu/static/past... · Posted by u/todsacerdoti
jinlisp · 2 months ago
Both slip and jscl takes the same time in my computer: 63 seconds to run the loop.
mishoo · 2 months ago
Hm, you're right, JSCL seems abnormally slow on this loop (27.5 sec here). SLip consistently takes 19.3 sec. My CPU is rather beefy (Ryzen 9 HX 370). What's your hardware and browser?

But JSCL is much faster on the fib example, that's why I thought it should be generally faster. After all, it compiles to JS.

mishoo commented on Web Embeddable Common Lisp   turtleware.eu/static/past... · Posted by u/todsacerdoti
jinlisp · 2 months ago
When executing (time (loop for i below (expt 10 8) count t)) it takes a long time, sbcl takes less than a second on this. So not useful when speed is required. More: (time (loop for i below 1000000 count t) takes 7 seconds on my computer, so counting to (exp 10 8) would take 700 seconds, and sbcl do that in 0.1 seconds, so in this example the ratio is 7000 times slower than sbcl.
mishoo · 2 months ago
In SLip: https://lisperator.net/s/slip/

    SL-USER> (time (loop for i below (expt 10 8) count t))
    Evaluation time: 19376ms
    100000000

    SL-USER> (time (loop for i below 1000000 count t))
    Evaluation time: 272ms
    1000000

    SL-USER> (defun fib (n) (if (< n 2) n (+ (fib (- n 1)) (fib (- n 2)))))
    #'FIB
    SL-USER> (time (fib 32))
    Evaluation time: 1601ms
    2178309
These timings are in Firefox; Chromium is almost 2x faster. Also, it doesn't completely freeze the browser in the mean time (we have green threads).

I used to think it's quite slow, but somehow it's much faster than any other posted here. The only Lisp in browser I know to beat SLip (by a large margin) is JSCL, which compiles to JS.

mishoo commented on Arch Conf 2020 Streaming [video]   streaming.media.ccc.de/ar... · Posted by u/todsacerdoti
codeflo · 5 years ago
My main dev PC is running on Arch as well, and I have no intention to switch, but I'll disagree with many of the sibling comments: Arch breaks all the time.

One day, a Gnome update breaks all plugins, in one case making login in X impossible unless you manually deactivate stuff using the shell. The next time, a kernel update makes sound stop working after waking up from standby. It's mostly small regressions, and they usually get fixed a week later, but something temporarily stops working at least once every 2 months.

However, Arch also makes it much, much easier to run recent versions of, basically everything. You never have to fiddle around with 3rd-party package repos, you just install stuff and it works. It's how package managers are supposed to work, but not the experience I've ever had with Debian and Ubuntu. Of course, the fact that Pacman is fantastically fast compared to apt doesn't hurt either.

I love Arch. In aggregate, I think it prevents more headaches than it causes. But you have to be prepared for some unexpected problems and fiddling around.

mishoo · 5 years ago
This isn't an Arch problem, it's a Gnome problem. Extensions break all the time because in order to do anything non-trivial they must use "undocumented" APIs (well, there's no documentation anyway, just a hello world tutorial and then may the source be with you). I know it because I wrote my own extension [1] in order to make this desktop bearable.

After a while, though, I switched to KDE and life's good again.

[1] https://github.com/mishoo/boring-gnome-mishoo.github.com

mishoo commented on Show HN: A library to add a command promp (and telnet) to your programs   github.com/buserror/libmi... · Posted by u/buserror
mishoo · 5 years ago
Now add a Common Lisp compiler to it and you reinvented technology from the 80'es. :-)
mishoo commented on The Build is Always Broken   gbracha.blogspot.com/2020... · Posted by u/mhd
jcrites · 6 years ago
> You won't get what true "liveness" is until you work in Lisp or Smalltalk. The ability to change a function in a running program, without restarting it

This can be done in a number of other common languages today such as Java (JVM languages) and C# (probably all .NET languages). Most IDEs I've seen for those platforms support it.

Substantial enough changes to the code can require an application restart, but most changes you might make like changing the implementation of a function, adding new functions to a class, etc., will not. Hot Code Replacement (HCR) has been supported since Java 1.4: https://wiki.eclipse.org/FAQ_What_is_hot_code_replace%3F

Fully dynamic languages like Lisp and Smalltalk permit a greater degree of this than statically typed languages do, however, since they don't have types and a type system to wrangle with. When I've used it, hot code replacement supported most of the changes that conceptually make sense to support.

mishoo · 6 years ago
You'd be surprised to find out that Common Lisp has actually quite a strong type system (not Haskell-level but much better than C++/Java); just that it's optional. You get the best of both worlds — fast prototyping, and then when you decide upon the types, you can add type declarations, which usually result in (much!) faster code and robustness.
mishoo commented on The Build is Always Broken   gbracha.blogspot.com/2020... · Posted by u/mhd
skrebbel · 6 years ago
People love to complain about Webpack, but it pretty much does all of this out of box, all the way down to hot-reloading UI components. In that sense it's way ahead of all C++, C#, Java, etc build systems I know.

Doing an `npm run dev` type of command in a reasonably set up JS project is very much this staged execution model the author talks about. Everything gets cached, on disk and in memory, only changes are recompiled, and reloads are fast, partial, and often hot-swapped. It's quite close to the maximum level of "liveness" I can imagine.

It's kind of amazing how JS took over older and more established languages in this sense - and we're still not content (judging by how popular it is to complain about webpack). This is great.

mishoo · 6 years ago
You won't get what true "liveness" is until you work in Lisp or Smalltalk. The ability to change a function in a running program, without restarting it. Automatic reload might seem cool, but reload means your application restarts and loses state. Imagine you have some Web app and you open some menus/dialogs, perhaps it's connected to some server via WebSockets etc. and you find a bug somewhere, you go to the code to fix it, but reloading the page means you start from scratch and need to open again those menus/dialogs, and reconnect the sockets, in order to test your fix.

Common Lisp had true liveness for decades; it's almost mandated by the standard, it's designed in such a way that you can actually recompile a function, or even redefine objects, adding or removing properties or methods, at fucking runtime without restarting the application. Objects already instantiated will remain so and will be updated to reflect the change. You don't restart. That's the true "liveness", but seriously you don't get it until you try it, and once you get it you become depressed because you realize it doesn't really exist in any mainstream language.

JavaScript is some decades behind this dream, even with stuff like Webpack.

mishoo commented on Learn Git Branching   learngitbranching.js.org/... · Posted by u/gerbilly
mishoo · 7 years ago
Nicely done, but Courier is the ugliest font on Earth (I don't have Monaco). For the sake of humanity, never write "Courier" in a CSS file. ;-)
mishoo commented on Ask HN: What things have richly rewarded the time invested in mastering them?    · Posted by u/Carl_Platt
mishoo · 7 years ago
Emacs, the One True Program.

u/mishoo

KarmaCake day49November 27, 2009View Original