TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why I'm writing a Scheme implementation in 2025: Async Rust

198 pointsby maplant3 months ago

15 comments

reikonomusha3 months ago
Coalton [1] is a Lisp language that has Hindley-Milner type inference with type classes. Its syntax actually resembles the prototype syntax from TFA pretty closely. The Coalton syntax-equivalent would be:<p><pre><code> (define-type (Option :a) (Some :a) None) (let ((x (Some 5))) (match x ((Some y) y) ((None) (random)))) (declare random (Distribution :a =&gt; Unit -&gt; :a)) (define (random) (sample (thread-rng))) (define-class (Eq :t) (= (:t -&gt; :t -&gt; Boolean))) (define-instance (Eq Number) (define (= lhs rhs) (num-equal lhs rhs))) </code></pre> Of course types and classes like Option and Eq are built-in already.<p>Coalton is based on Common Lisp (and allows free mixing with CL code) instead of Scheme however, though Coalton is a Lisp-1 and would feel relatively at-home to any Scheme programmer.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;coalton-lang&#x2F;coalton">https:&#x2F;&#x2F;github.com&#x2F;coalton-lang&#x2F;coalton</a>
评论 #43090641 未加载
评论 #43090735 未加载
perrygeo3 months ago
Also a shout out to Steel (<a href="https:&#x2F;&#x2F;github.com&#x2F;mattwparas&#x2F;steel">https:&#x2F;&#x2F;github.com&#x2F;mattwparas&#x2F;steel</a>), another Scheme-on-Rust which is more active.<p>The Rust community has given us at least two Scheme runtimes, several JS runtimes, but no Clojure interpreter yet that I&#x27;m aware of. There are a few zombie projects squatting on the name (seems common in Rust) but no viable releases.
评论 #43092603 未加载
评论 #43092456 未加载
评论 #43102430 未加载
markstos3 months ago
The Helix editor, a popular alternative to Vim, is going to implementing it&#x27;s plugin system in a Scheme-like language. Helix is also written in Rust.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;helix-editor&#x2F;helix&#x2F;discussions&#x2F;3806#discussioncomment-6686976">https:&#x2F;&#x2F;github.com&#x2F;helix-editor&#x2F;helix&#x2F;discussions&#x2F;3806#discu...</a>
MathMonkeyMan3 months ago
Nice work! It&#x27;s a good write-up, too.<p>Hygienic macro expansion is one of the things I still haven&#x27;t implemented before. I remember a [talk][1] where Matthew Flatt illustrates the idea of sets of scopes, and choosing the largest intersection. I see in your implementation there are sets of &quot;marks&quot; in syntax objects, is that what&#x27;s going on there?<p>I haven&#x27;t played with rust, but when I do I&#x27;ll be able to play with this scheme too.<p>[1]: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Or_yKiI3Ha4" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Or_yKiI3Ha4</a>
评论 #43089709 未加载
leftyspook3 months ago
I think you make a pretty bad case for how embedding a Scheme interpreter is going to help with the pain points of async. Listing &quot;stack traces full of tokio code&quot; and then seemingly proposing to solve that by adding more glue to pollute the stack traces is especially weird.
评论 #43089753 未加载
评论 #43092087 未加载
评论 #43094317 未加载
ilrwbwrkhv3 months ago
What would be really nice is a new lisp which actually allows for incredibly interactive programming similar to common lisp, but which targets a runtime like the v8 engine maybe. Because I think a lot of people are missing out on the Smalltalk &#x2F; Common Lisp experience.<p>Even Clojure and other lisps do not enable that level of interactive programming which the break loop in Common Lisp does.
评论 #43092420 未加载
packetlost3 months ago
I&#x27;m more of a R7RS kinda guy but I appreciate this, especially the types. Scheme allows for extremely non-linear memory access which means you necessarily need dynamic memory management and garbage collection. IMO once you&#x27;re to that spot, there&#x27;s little reason to stick with Rust, though it being the implementation language is interesting in itself. That being said, there are battle tested Scheme implementations out there that have fantastic FFI APIs that would probably work just as well if you don&#x27;t mind a small bit of C to glue things together.
mightyham3 months ago
This seems like a great idea and I support the effort. It was not clear to me on first read though that what was being proposed is not an extension to current async rust (compiling code to a series of state machines), but a completely alternative design utilizing a context switching runtime like Erlang or Go. If I interpreted that wrong please correct me.<p>Part of me wonders, considering that rust is a systems programming language, how difficult would it be to write a runtime like that in rust so that there is no need to use a second language?
评论 #43092054 未加载
评论 #43092138 未加载
valorzard3 months ago
Is the name Gouki a Street Fighter Reference? (For those not in the know, Gouki is the Japanese name for Akuma)
评论 #43093462 未加载
api3 months ago
I wonder if people are in a way misusing Rust by trying to use it to build everything. It&#x27;s designed to be a systems language, one for writing OSes, drivers, core system services, low level parsers, network protocols, compilers, runtimes, etc.<p>There&#x27;s no way a low-level systems language like this is going to be quite as ergonomic as a higher level more abstract garbage collected language.
评论 #43092449 未加载
评论 #43092201 未加载
giancarlostoro3 months ago
To the author, if you&#x27;re reading this:<p>&gt; But while I thing that async Rust is well designed<p>At least one typo, thank you for not using an LLM to spit out an article. :)
hardwaresofton3 months ago
Glad to see more language runtimes be available from Rust!<p>Looking forward to scheme-rs being able to benefit from the safety and speed Rust allows
评论 #43092207 未加载
whitten3 months ago
What is a Tokio function ?<p>What is CPS ?
评论 #43093080 未加载
评论 #43092484 未加载
IshKebab3 months ago
Why do people put up with the Lisp syntax? I get that it&#x27;s super simple for computers to parse, but it&#x27;s definitely not pleasant for <i>humans</i> to parse, and humans are the ones reading&#x2F;writing code.<p>I would have thought some very simple syntactic sugar would make it a lot nicer to work with. Has anyone done that?
评论 #43095847 未加载
评论 #43094606 未加载
评论 #43095148 未加载
评论 #43094788 未加载
评论 #43106305 未加载
timewizard3 months ago
&gt; I believe that it is a remarkably well designed language<p>&gt; and just overall a poor debugging experience make async Rust a frustrating experience for rapid iteration.<p>&gt; is the result of conscious trade-offs, trade-offs that I believe were chosen correctly. I don’t believe that async Rust necessarily needs to change at all, although I don’t doubt that the experience could be improved.<p>That&#x27;s rust for you. It&#x27;s a remarkably well designed language. Except for all the ways it isn&#x27;t. What&#x27;s hilarious to me is none of these are even deep or hard to find issues. Right out of the gate.. cargo is a wart.. and async was designed inside out.<p>Remarkable. Indeed.<p>So, _of course_, let&#x27;s use it to implement a _different_ language entirely. The niche is disappearing.
评论 #43095835 未加载