News for hackers. Stuff that matters.
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by orthecreedence on Wednesday October 27, 2021 @05:31PM (#29019394)
So you're not running anything truly async, you're just using threading at a lower level? I don't get what Woo really provides to the async ecosystem in CL.
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by gibsonf1 on Wednesday October 27, 2021 @05:37PM (#29019454)
Woo is a superfast web server. It handles receiving 4x the number of requests that node js can. Once the server gets the request, you can control how the response works with futures etc. Our front end webapp is using Vue cli, which clearly is javascript. I assumed the discussion here was about the server, not the front end webapp on the browser.
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by orthecreedence on Wednesday October 27, 2021 @05:50PM (#29019555)
The discussion was about an app server written in CL (Wookie) that supports a backend app written in CL, all in async (via cl-async).

It seems to me you're using Woo as an Nginx replacement, not as a CL app server, which makes total sense to me after you described the model you're using.

Re:Why Turtl switched from Common Lisp to JavaScript (2019) by wyager on Wednesday October 27, 2021 @06:09PM (#29019719)
I wouldn’t describe 4x nodejs as “super fast”. Nodejs is one of the slowest popular backends, or at least it was when I did a comparison a few years ago.
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by gibsonf1 on Wednesday October 27, 2021 @06:20PM (#29019793)
In the last benchmarks, woo beat all including the Go webserver: Scroll down just a bit to see the comparisons here: https://github.com/fukamachi/woo
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by wyager on Wednesday October 27, 2021 @11:31PM (#29022069)
Nice. Node has gotten a lot faster than when I last looked apparently. In fact, I’m a bit suspicious of the benchmark they’re using.
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by Jtsummers on Wednesday October 27, 2021 @05:45PM (#29019508)
What is your distinction between "async" and "using threading at a lower level"?
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by orthecreedence on Wednesday October 27, 2021 @06:09PM (#29019720)
In this case, an async (via cl-async) application served by an async app server (http://wookie.lyonbros.com/), so async all the way down using evented I/O vs an async server (Woo) that farms out all requests to a synchronous thread pool.

I've been asked multiple times why I "didn't just use Woo" by people who don't understand that Turtl's server was async and Woo doesn't support async.

Re:Why Turtl switched from Common Lisp to JavaScript (2019) by gibsonf1 on Wednesday October 27, 2021 @07:43PM (#29020527)
I guess the question is what does that have to do with it? Why not just work asynchronusly with requests that hit the server with a library like lparallel with their futures? Isn't it about the response to the request?
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by orthecreedence on Thursday October 28, 2021 @03:12AM (#29023296)
> Isn't it about the response to the request?

High level, yes. Mid/low-level, it really depends on what you're doing. If you're serving static files, sure, use Nginx/Woo. If you're running an evented CL application that deals mostly with network i/o, threading is going to be a tank when you need a hummingbird.

I built cl-async/wookie as parallels for nodejs/express in common lisp.

Re:Why Turtl switched from Common Lisp to JavaScript (2019) by math-dev on Thursday October 28, 2021 @05:55AM (#29024153)
Oh, are you the developer mentioned in the main post?

If so, I agree a lot with what you said!

Re:Why Turtl switched from Common Lisp to JavaScript (2019) by orthecreedence on Friday October 29, 2021 @04:02PM (#29042937)
I am! Turtl is my baby.
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by math-dev on Sunday October 31, 2021 @03:06PM (#29059423)
Awesome stuff!
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by Karrot_Kream on Wednesday October 27, 2021 @07:14PM (#29020226)
The post talks about using libuv which uses event loops all the way down. I'll be honest, this whole line of questioning feels quite dismissive; OP probably knows exactly _why_ they want an event loop design, you shouldn't try to talk them into using granular thread pools.
Re:Why Turtl switched from Common Lisp to JavaScript (2019) by Jtsummers on Wednesday October 27, 2021 @07:29PM (#29020378)
I think you're responding to the wrong person as I didn't "try to talk them into using granular thread pools".

I asked for clarification on the distinction between "async" and "using threading at a lower level", which, for me, are equivalent things. The distinction, to the extent there is one, being that "async" often means "an existing library or language feature versus rolling it myself".

Re:Why Turtl switched from Common Lisp to JavaScript (2019) by Karrot_Kream on Wednesday October 27, 2021 @08:08PM (#29020748)
Evented ("async") concurrency, as found in Node, Python, Rust/Tokio, libuv, and Ocaml is based on building chains of events which are waited on by some fast polling mechanism like epoll or kqueue. Any IO call, say a socket read, tells kqueue/epoll to notify some handler to service the event. The flow of events drives execution.

This is distinct from thread pool models where you still block the entire thread for an IO call. While a sufficiently smart scheduler can probably then context switch out of this thread onto something else as the thread waits for an IO response, this is distinct from having the event directly wake up a handler.

That's usually what I associate as the difference between an event loop model and a threaded model. You can certainly make your threads highly granular and isolate each distinct blocking operation to its own thread pool, but it's different from actually being notified and woken up for events.

> I think you're responding to the wrong person as I didn't "try to talk them into using granular thread pools".

Yeah I think my wires got a bit crossed there. Apologies. That's what I get for being snarky while not paying full attention.