Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #114811 > unrolled thread
| Started by | Mild Shock <janburse@fastmail.fm> |
|---|---|
| First post | 2024-02-10 03:41 +0100 |
| Last post | 2024-03-03 20:26 +0100 |
| Articles | 9 — 3 participants |
Back to article view | Back to comp.lang.javascript
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Mild Shock <janburse@fastmail.fm> - 2024-02-10 03:41 +0100
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Mild Shock <janburse@fastmail.fm> - 2024-02-20 17:09 +0100
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-20 19:41 +0000
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Mild Shock <janburse@fastmail.fm> - 2024-02-21 00:54 +0100
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Mild Shock <janburse@fastmail.fm> - 2024-02-21 00:56 +0100
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Mild Shock <janburse@fastmail.fm> - 2024-02-21 01:13 +0100
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Mild Shock <bursejan@gmail.com> - 2024-02-20 16:20 -0800
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Mild Shock <janburse@fastmail.fm> - 2024-02-21 13:37 +0100
Re: ANN: Dogelog Player 1.1.5 (HTTP Server) Mild Shock <janburse@fastmail.fm> - 2024-03-03 20:26 +0100
| From | Mild Shock <janburse@fastmail.fm> |
|---|---|
| Date | 2024-02-10 03:41 +0100 |
| Subject | Re: ANN: Dogelog Player 1.1.5 (HTTP Server) |
| Message-ID | <uq6nnt$1jfbj$2@solani.org> |
We already reported the new capability that we can read async from streams. We made this available for the file system reads on nodeJS. We report here about a further progress extending the async approach to HTTP fetch in the browser and on nodeJS. Multiple downloads make a case for async I/O since RFC 2616 limits the number of connections. HTTP/2 allows to send off multiple requests which async I/O can capitalize. We demonstrate quasi-parallel execution in Dogelog Player for both the browser and nodeJS. See also: Async HTTP Client for Dogelog Player https://twitter.com/dogelogch/status/1756144112946807135 Async HTTP Client for Dogelog Player https://www.facebook.com/groups/dogelog
[toc] | [next] | [standalone]
| From | Mild Shock <janburse@fastmail.fm> |
|---|---|
| Date | 2024-02-20 17:09 +0100 |
| Message-ID | <ur2ish$ci33$2@solani.org> |
| In reply to | #114811 |
Dogelog Player is a Prolog system that features a ‘$YIELD’/1 instruction. The instruction was conceived for single threaded runtimes with an event loop. We could now demonstrate how to realize it without an explicit event loop in a multi threaded runtime. The idea is that threads use a bouncer semaphore to get a permission to execute and thus become “coroutines”. Now that we have layed the foundation we started asyncifying Dogelog Player for Java. We demonstrate a HTTP server and HTTP client interaction in the same JVM. See also: Surrogate Async/Await with JDK 21 https://twitter.com/dogelogch/status/1759972607355470296 Surrogate Async/Await with JDK 21 https://www.facebook.com/groups/dogelog Mild Shock schrieb: > > We already reported the new capability > that we can read async from streams. We made > this available for the file system reads on > nodeJS. We report here about a further progress > extending the async approach to HTTP fetch in > the browser and on nodeJS. > > Multiple downloads make a case for async I/O > since RFC 2616 limits the number of connections. > HTTP/2 allows to send off multiple requests > which async I/O can capitalize. We demonstrate > quasi-parallel execution in Dogelog Player for > both the browser and nodeJS. > > See also: > > Async HTTP Client for Dogelog Player > https://twitter.com/dogelogch/status/1756144112946807135 > > Async HTTP Client for Dogelog Player > https://www.facebook.com/groups/dogelog
[toc] | [prev] | [next] | [standalone]
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Date | 2024-02-20 19:41 +0000 |
| Message-ID | <ur2v8l$2lhr7$3@dont-email.me> |
| In reply to | #122551 |
On Tue, 20 Feb 2024 17:09:53 +0100, Mild Shock wrote: > The idea is that threads use a bouncer semaphore to get a permission to > execute and thus become “coroutines”. But they are still stackful coroutines, not stackless.
[toc] | [prev] | [next] | [standalone]
| From | Mild Shock <janburse@fastmail.fm> |
|---|---|
| Date | 2024-02-21 00:54 +0100 |
| Message-ID | <ur3e4a$d07q$1@solani.org> |
| In reply to | #122661 |
Well they have suspend/resume semantics. They are not continuations. They aim is to provide async/await and not only setTimeout(). As a result you don't need to write libraries with a continuation parameters. This is very unlike nonsense such as the express web framework. stackfulness In contrast to a stackless coroutine a stackful coroutine can be suspended from within a nested stackframe. Execution resumes at exactly the same point in the code where it was suspended before. stackless With a stackless coroutine, only the top-level routine may be suspended. Any routine called by that top-level routine may not itself suspend. This prohibits providing suspend/resume operations in routines within a general-purpose library. https://www.boost.org/doc/libs/1_57_0/libs/coroutine/doc/html/coroutine/intro.html#coroutine.intro.stackfulness Lawrence D'Oliveiro schrieb: > On Tue, 20 Feb 2024 17:09:53 +0100, Mild Shock wrote: > >> The idea is that threads use a bouncer semaphore to get a permission to >> execute and thus become “coroutines”. > > But they are still stackful coroutines, not stackless. >
[toc] | [prev] | [next] | [standalone]
| From | Mild Shock <janburse@fastmail.fm> |
|---|---|
| Date | 2024-02-21 00:56 +0100 |
| Message-ID | <ur3e85$d07q$2@solani.org> |
| In reply to | #122827 |
Basically you can programm in so called "DIRECT STYLE" even if async I/O is involved, which might be even a shock for functional programming language users that are used to a lot of nonsense. See also: Async/Await for the Monadic Programmer https://www.youtube.com/watch?v=OH5cxLNTTPo DIRECT STYLE SCALA Scalar Conference 2023 https://www.youtube.com/watch?v=0Fm0y4K4YO8 Mild Shock schrieb: > > Well they have suspend/resume semantics. They > are not continuations. They aim is to provide > async/await and not only setTimeout(). > > As a result you don't need to write libraries > with a continuation parameters. This is very unlike > nonsense such as the express web framework. > > stackfulness > In contrast to a stackless coroutine a stackful > coroutine can be suspended from within a nested > stackframe. Execution resumes at exactly the same > point in the code where it was suspended before. > > stackless > With a stackless coroutine, only the top-level routine > may be suspended. Any routine called by that top-level > routine may not itself suspend. This prohibits > providing suspend/resume operations in routines within > a general-purpose library. > https://www.boost.org/doc/libs/1_57_0/libs/coroutine/doc/html/coroutine/intro.html#coroutine.intro.stackfulness > > > > Lawrence D'Oliveiro schrieb: >> On Tue, 20 Feb 2024 17:09:53 +0100, Mild Shock wrote: >> >>> The idea is that threads use a bouncer semaphore to get a permission to >>> execute and thus become “coroutines”. >> >> But they are still stackful coroutines, not stackless. >> >
[toc] | [prev] | [next] | [standalone]
| From | Mild Shock <janburse@fastmail.fm> |
|---|---|
| Date | 2024-02-21 01:13 +0100 |
| Message-ID | <ur3f7b$d0ob$1@solani.org> |
| In reply to | #122829 |
Its also proof of concept that no stack copying is necessary. Well its not 100% true the Prolog interpreter does a little bit unwind and rewind during the '$YIELD'/1 instruction. But we do nowhere copy some native stack, this is unlike Martin Odersky's speculation, he might implement someting with stack copying. Except that a virtual threads might using a copying when they resize their stack, I don't see any need for copying. Also sometimes a callback can be piggy packed on an existing coroutine if it doesn't yield itself, I am already using this in Dogelog Player as an optimization. The idea to use semaphores in my implementation can be credited to this paper from 1980 where semaphores are the main switchpoint: Extension of Pascal and its Application to Quasi-Parallel Programming and Simulation, Software - Practice and Experience, 10 (1980), 773-789 J. Kriz and H. Sandmayr https://www.academia.edu/47139332 But my experience with JDK 21 virtual threads is still poor, I am only beginning to explore them as a way to have a large number of coroutines. Mild Shock schrieb: > > Basically you can programm in so called "DIRECT STYLE" > even if async I/O is involved, which might be even a > shock for functional programming language users > > that are used to a lot of nonsense. > > See also: > > Async/Await for the Monadic Programmer > https://www.youtube.com/watch?v=OH5cxLNTTPo > > DIRECT STYLE SCALA Scalar Conference 2023 > https://www.youtube.com/watch?v=0Fm0y4K4YO8 > > Mild Shock schrieb: >> >> Well they have suspend/resume semantics. They >> are not continuations. They aim is to provide >> async/await and not only setTimeout(). >> >> As a result you don't need to write libraries >> with a continuation parameters. This is very unlike >> nonsense such as the express web framework. >> >> stackfulness >> In contrast to a stackless coroutine a stackful >> coroutine can be suspended from within a nested >> stackframe. Execution resumes at exactly the same >> point in the code where it was suspended before. >> >> stackless >> With a stackless coroutine, only the top-level routine >> may be suspended. Any routine called by that top-level >> routine may not itself suspend. This prohibits >> providing suspend/resume operations in routines within >> a general-purpose library. >> https://www.boost.org/doc/libs/1_57_0/libs/coroutine/doc/html/coroutine/intro.html#coroutine.intro.stackfulness >> >> >> >> Lawrence D'Oliveiro schrieb: >>> On Tue, 20 Feb 2024 17:09:53 +0100, Mild Shock wrote: >>> >>>> The idea is that threads use a bouncer semaphore to get a permission to >>>> execute and thus become “coroutines”. >>> >>> But they are still stackful coroutines, not stackless. >>> >> >
[toc] | [prev] | [next] | [standalone]
| From | Mild Shock <bursejan@gmail.com> |
|---|---|
| Date | 2024-02-20 16:20 -0800 |
| Message-ID | <bb4cb7d2-e206-49f8-9336-00f3516fc854n@googlegroups.com> |
| In reply to | #122838 |
Also the Kotlin language and runtime might suffer from not enough "DIRECT STYLE" and even ignoring Doug Leas java.util.concurrent.Flow, devlivering some bloated redundant nonsense I speculate from glossing over it. Flow has an interesting history. And all the new JDK 21 integrate HTTP server and HTTP client make use of the interfaces bundled by the class Flow. But I am tapping into it via ordinary InputStream and OutputStream. Reactive Streams started as an initiative in late 2013 between engineers at Netflix, Pivotal and Lightbend. Reactive Streams were proposed to become part of Java 9 by Doug Lea, leader of JSR 166 as a new Flow class that would include the interfaces currently provided by Reactive Streams. https://en.wikipedia.org/wiki/Reactive_Streams Mild Shock schrieb am Mittwoch, 21. Februar 2024 um 01:13:39 UTC+1: > Its also proof of concept that no stack copying > is necessary. Well its not 100% true the Prolog > interpreter does a little bit unwind and rewind > > during the '$YIELD'/1 instruction. But we do > nowhere copy some native stack, this is unlike > Martin Odersky's speculation, he might implement > > someting with stack copying. Except that a virtual > threads might using a copying when they resize > their stack, I don't see any need for copying. > > Also sometimes a callback can be piggy packed on > an existing coroutine if it doesn't yield itself, > I am already using this in Dogelog Player as an > > optimization. The idea to use semaphores in my > implementation can be credited to this paper > from 1980 where semaphores are the main switchpoint: > > Extension of Pascal and its Application to > Quasi-Parallel Programming and Simulation, Software - > Practice and Experience, 10 (1980), 773-789 > J. Kriz and H. Sandmayr > https://www.academia.edu/47139332 > > But my experience with JDK 21 virtual threads > is still poor, I am only beginning to explore them > as a way to have a large number of coroutines. > > Mild Shock schrieb: > > > > Basically you can programm in so called "DIRECT STYLE" > > even if async I/O is involved, which might be even a > > shock for functional programming language users > > > > that are used to a lot of nonsense. > > > > See also: > > > > Async/Await for the Monadic Programmer > > https://www.youtube.com/watch?v=OH5cxLNTTPo > > > > DIRECT STYLE SCALA Scalar Conference 2023 > > https://www.youtube.com/watch?v=0Fm0y4K4YO8 > > > > Mild Shock schrieb: > >> > >> Well they have suspend/resume semantics. They > >> are not continuations. They aim is to provide > >> async/await and not only setTimeout(). > >> > >> As a result you don't need to write libraries > >> with a continuation parameters. This is very unlike > >> nonsense such as the express web framework. > >> > >> stackfulness > >> In contrast to a stackless coroutine a stackful > >> coroutine can be suspended from within a nested > >> stackframe. Execution resumes at exactly the same > >> point in the code where it was suspended before. > >> > >> stackless > >> With a stackless coroutine, only the top-level routine > >> may be suspended. Any routine called by that top-level > >> routine may not itself suspend. This prohibits > >> providing suspend/resume operations in routines within > >> a general-purpose library. > >> https://www.boost.org/doc/libs/1_57_0/libs/coroutine/doc/html/coroutine/intro.html#coroutine.intro.stackfulness > >> > >> > >> > >> Lawrence D'Oliveiro schrieb: > >>> On Tue, 20 Feb 2024 17:09:53 +0100, Mild Shock wrote: > >>> > >>>> The idea is that threads use a bouncer semaphore to get a permission to > >>>> execute and thus become “coroutines”. > >>> > >>> But they are still stackful coroutines, not stackless. > >>> > >> > >
[toc] | [prev] | [next] | [standalone]
| From | Mild Shock <janburse@fastmail.fm> |
|---|---|
| Date | 2024-02-21 13:37 +0100 |
| Message-ID | <ur4qqu$dq1q$1@solani.org> |
| In reply to | #122661 |
Thanks for asking. I made the Prolog system source code docu a little bit clearer now: From the JavaScript file "machine.mjs": /** * Run a callback once, i.e. no choice point or trailing left * behind. Callbacks are run with auto-yield disabled and * promises are not accepted, i.e. run "stackless" on top of the * given main stack or side stack. "stackless" because completion, * i.e. return or exception by the callback, is the only context switch. */ export function launch(form, buf, params); /** * Run a task once, i.e. no choice point or trailing left * behind. Tasks are run with auto-yield enabled and promises are * accepted, i.e. run "stackfull" on top of the given main stack * or side stack. "stackfull" because not only completion, i.e. * return or exception by the task, cause a context switch, but * also await of an auto-yield or promise. */ export async function launch_async(form, buf, params); You find this in the Dogelog Player GIT. Lawrence D'Oliveiro schrieb: > On Tue, 20 Feb 2024 17:09:53 +0100, Mild Shock wrote: > >> The idea is that threads use a bouncer semaphore to get a permission to >> execute and thus become “coroutines”. > > But they are still stackful coroutines, not stackless. >
[toc] | [prev] | [next] | [standalone]
| From | Mild Shock <janburse@fastmail.fm> |
|---|---|
| Date | 2024-03-03 20:26 +0100 |
| Message-ID | <us2itc$tchi$3@solani.org> |
| In reply to | #123298 |
Dogelog Player was born in 2021 after heated internet discussions. Its a project of an async Prolog system, that can be used for backend server development or inside a web browser client. Currently Dogelog Player is fully open source and gets the most care by its founding company. A couple of Prolog systems provide sponsor buttons, mainly powered by GitHub. On the other hand Crypto wallets projections indicating exponential growth. We setup a donation page, based on Solana, which is deemed highly energy efficient, minimizing its global carbon footprint. See also: Sustainable Appreciation for Dogelog Player https://twitter.com/dogelogch/status/1764369222270927180 Sustainable Appreciation for Dogelog Player https://www.facebook.com/groups/dogelog
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web