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.

Fargo: new Scheme-like language working in Node.js/browser

94 pointsby sphynxabout 14 years ago

11 comments

turbolentabout 14 years ago
I've been working on Ralph for a while now: <a href="https://github.com/turbolent/ralph" rel="nofollow">https://github.com/turbolent/ralph</a><p>It compiles a major subset of Apple's Dylan (<a href="http://lispm.dyndns.org/documentation/prefix-dylan/book.annotated/annotated-manual.html" rel="nofollow">http://lispm.dyndns.org/documentation/prefix-dylan/book.anno...</a>) to JavaScript, both for use on a CommonJS implementation and in the browser. A bootstrapping compiler is implemented in JS, but the same compiler is also available in Ralph itself and features define-macro (Cl-like). The whole runtime is defined in Ralph as well and provides a single-inheritance object system (including next-method): <a href="https://github.com/turbolent/ralph/blob/master/src/runtime/core.ralph" rel="nofollow">https://github.com/turbolent/ralph/blob/master/src/runtime/c...</a><p>Almost all of the features are shown in <a href="https://github.com/turbolent/ralph/blob/master/src/tests/runtime-tests.ralph" rel="nofollow">https://github.com/turbolent/ralph/blob/master/src/tests/run...</a> and I'm using it a project now. To build HTML5 apps, there's a small toolbox: <a href="https://github.com/turbolent/toolbox" rel="nofollow">https://github.com/turbolent/toolbox</a><p>Maybe it's useful to someone else. Cheers
评论 #2499066 未加载
评论 #2497104 未加载
iceyabout 14 years ago
<p><pre><code> &#62; (+ 1 1 1 1) =&#62; 2 &#62; (* 3 4 5 6) =&#62; 12 </code></pre> Does it only consider the first and second items in a list?
评论 #2494402 未加载
评论 #2505681 未加载
edwabout 14 years ago
Well, TCO seems to work:<p><pre><code> (define (count x) (let loop ((x x) (sum 0)) (if (zero ? x) sum (loop (- x 1) (+ sum x))))) (count 100000) ; ==&#62; 5000050000 (doesn't blow up) </code></pre> I'm very tempted to help out however I can. I've been dreaming of using Scheme instead of JS in a Node.js setting.
judofyrabout 14 years ago
The more interesting feature of Fargo is coroutines (which can make async programming easier): <a href="https://github.com/jcoglan/fargo" rel="nofollow">https://github.com/jcoglan/fargo</a>
DTrejoabout 14 years ago
Also, SibilantJS (which seems more mature at the moment, as `npm install sibilant` works, but `npm install fargo` does not):<p><a href="http://sibilantjs.info/#welcome" rel="nofollow">http://sibilantjs.info/#welcome</a>
评论 #2496829 未加载
nkassisabout 14 years ago
I'm a newb or something but :<p>(cdr ()) makes it explode. What's nil? null nil don't exist<p>I do really like this. I was hoping for something like this where it would allow me to write lisp instead of javascript.
评论 #2495889 未加载
评论 #2496845 未加载
pflanzeabout 14 years ago
Any reason why not to implement call/cc and then write fibers in terms of call/cc? The implementation may not actually be any different from what it is. (I've not studied the code enough to understand how it implements fibers, although I got the impression that it handles call frames explicitely (source/fargo/runtime/stack{,less}.js).)
评论 #2496813 未加载
shivenabout 14 years ago
Isn't Shen a very similar idea? Bringing functional programming to Javascript.<p>It is expected to be released very soon for Javascript (and Scheme).<p>[1]: <a href="http://news.ycombinator.com/item?id=1921347" rel="nofollow">http://news.ycombinator.com/item?id=1921347</a><p>[2]: <a href="https://groups.google.com/group/qilang/msg/bd474d815479b50a?hl=en" rel="nofollow">https://groups.google.com/group/qilang/msg/bd474d815479b50a?...</a>
LeonidasXIVabout 14 years ago
Hmm, I actually hoped for Clojure on Node.js (don't get me wrong, Scheme is beautiful and this seems to be quite a capable implementation but Clojure is way more practical) but hmm, I hope this gets popular.
评论 #2495706 未加载
评论 #2495614 未加载
d0mabout 14 years ago
Is there a similar version (something like Heist) but for Python?
caioariedeabout 14 years ago
The double quotes does not work on MacOSX/Chrome?