8 ms·
Scheme in Scheme on WASM in the browser
- lamerose 3y agoPreferable to doing the Javascript edition of SICP.
- odyssey7 3y agoAlas, the focus is on optimizing job placement at graduation, so intellectually engaging choices are lower priority. We’re in a situation where CS departments are incentivized to spend every year that a student is in school optimizing their ability to produce BFS or DFS in Python within 15 minutes.
- epgui 3y agoMaybe I'm missing something, but it sounds like you're making a general statement from a very specific and personal situation?
- ethanwillis 3y agoIt's not specific and personal. Obviously it doesn't apply 100% but there is definitely a trend towards rote memorization and single language focus.
- pvg 3y agodefinitely a trend towards rote memorization and single language focus What's some evidence of this trend you can think of?
- baq 3y agoLeetcode?
- odyssey7 3y agoI'd be interested in seeing an analysis that traces the programming language paths built into university curricula and how those paths have tended to change over the years. The weakening of theory components is also of interest. My sense is that the trends are real, based on what I've noticed and conversations with instructors in higher education, but I don't have an empirical dataset to support it. A decent theoretical model can be extrapolated from Goodhart's law. Graduates' performance on programming and leetcode-style interviews is a measure that many stakeholders care about, so it's a target for university departments that would lose value as a measure of educational quality. As a CS department optimizes its performance on that measure, elements of the curriculum are reprioritized. It becomes okay for the department to sacrifice educational quality in order to enhance performance on the measure. What doesn't go directly into the measure, such as experience outside of a core programming language intended for programming interviews, gets chipped away over the years through market pressures as universities' graduates compete for relative performance on the measure. This is a theoretical model, but to me it's convincing.
- odyssey7 3y agoWell, it's up to the reader to follow the implications. But the industry does hold sway in the design of university curricula, sometimes to the disappointment of academics, and this is nothing new. For example, back in 2001, Dijkstra expressed his dismay at Java replacing a different functional programming language, Haskell, in UT Austin's introductory programming course. https://www.cs.utexas.edu/users/EWD/transcriptions/OtherDocs/Haskell.html https://www.cs.utexas.edu/users/EWD/transcriptions/OtherDocs... Also consider that MIT used the Scheme version of SICP as their introductory programming textbook for years, and it remains a classic, but nowadays MIT leans into Python for introductory programming courses.
- pvg 3y agoDijkstra was a great computer scientist who was also very generous with his expressions of dismay. You can find him expressing dismay over a great variety of topics not all of which have turned out to merit it in the long run.
- ethanwillis 3y agoThis says nothing about whether or not this specific instance of dismay is warranted. All you've said is a man can't be right 100% of the time which I don't find very useful.
- lll-o-lll 3y agoYou have been voted down, but this is 100% truth. I’d been a professional software developer for 10 years and programming since a young child when I stumbled across the MIT Scheme open course (this was nearly 10 years ago now). Learning Scheme as an exercise dramatically improved me as a software developer, as it is the near perfect teaching language. The fundamentals of most computer science concepts are so clearly laid out, with no distractions. I wish I’d had the exposure at a younger age! MIT Scheme is pretty much useless as a practical language, vastly less useful than Python. Python is infinitely more powerful to actually “make things”. But this is not the point of University! The academic languages are powerful for learning, and it is a huge shame that they are being replaced with “professionally relevant” languages.
- lamerose 3y agoNot a fan of Python, but it isn't too bad pedagogically speaking. JS on the other hand... I hope WASM can one day kill it, leave it obsolete, and have it forcefully deprecated like Flash.
- d-lisp 3y agoCan you explain what you find bad about js ? I use typescript and I am honestly finding it awesome; and I am the type of person that coded in lisp for a long time. We have lambdas, flexible structures, FP methods (map, filter, reduce...), can express recursion easily, we have ternary operators, array and object destructuring (const {a,b,...rest}=init()). We have a nice way to deal with asynchronicity. We have some kind of class system. And thanks to typescript we have a really great and expressive type system that's very cool and eases the job a lot.
- nxobject 3y agoSadly true - I majored in math in college and had no plans of going into a programming-heavy job, so I was able to take fun “applied” CS classes like a “language grand tour” or physically based rendering, but skip core classes with those pressures like algorithms etc. entirely.
- deleted 3y ago[deleted]
- bjoli 3y agoIhave been using guile extensively for a couple of years. It has destroyed writing recursive functions in other languages for me. There are no stack overflows in guile, and a recursive function won't fail until you have used all a avilable memory. This lets you write very elegant functions in places where the state is a tree or a linear data structure. Doing the same in python means having to actually deal with state. It just feels so unnecessary and error prone.
- gumby 3y agoI only looked at WASM when the spec was first released but at that time it looked like tail call was not possible. Has that been corrected?
- k__ 3y agoSeemingly https://v8.dev/blog/wasm-tail-call https://v8.dev/blog/wasm-tail-call
- csjh 3y agoSupport is still mediocre (mainly because of safari)
- odyssey7 3y agoNice! Is there hope that V8 will also support proper tail calls in JavaScript? Update: The ticket for v8 to support JavaScript tail call optimization remains open but hasn’t been updated in a couple years. https://bugs.chromium.org/p/v8/issues/detail?id=4698 https://bugs.chromium.org/p/v8/issues/detail?id=4698
- k__ 3y ago
- ryukafalz 3y agoThis is exciting stuff! It feels like Hoot is moving forward at lightning speed these days. Love seeing all these cool demos.
- dannyobrien 3y agoI don't have favorites, but Spritely is definitely an equal favorite for the projects we support at the Filecoin Foundation for the Decentralized Web. Others HNers may also be interested in include: * Internet Archive's Democracy's Library https://blog.archive.org/2022/10/19/announcing-democracys-library/ https://blog.archive.org/2022/10/19/announcing-democracys-li... * Distributed Press https://distributed.press/ https://distributed.press/ * Guardian Project https://guardianproject.info/ https://guardianproject.info/ * MuckRack Document Cloud https://muckrack.com/ https://muckrack.com/ * Harvard Library Innovation Lab https://lil.law.harvard.edu/ https://lil.law.harvard.edu/ * Human Rights Data Analysis Group https://hrdag.org/data-publication/ https://hrdag.org/data-publication/ Longer list here: https://ffdweb.org/explore/#partners https://ffdweb.org/explore/#partners
- deleted 3y ago[deleted]
- wslh 3y agoThis is amazing. I am not finding the link to open a Scheme REPL in the browser (without doing my developer job). Am I missing something?
- davexunit 3y agoThe demo is embedded in a iframe towards the bottom of the post. If you are using a browser that is Wasm GC and tail call capable, you'll see something that resembles the gif at the top of the post. If not, you'll see a message about needing to use a different browser.
- ljm 3y agoMay I suggest rendering it on a full page of its own and then linking to it, too? The current form is too low-key since it looks like a screenshot.
- giancarlostoro 3y agoI love this, I had this idea back in 2020, a lisp that compiles to WASM, and then can compile itself to WASM at run-time in the browser, or any WASM run-time, dogfeed itself. I'm not a compiler guru by any means, so its just one of many things on my bucket list.
- lamerose 3y agoThe article is presenting a Scheme interpreter running in Scheme, compiled to WASM, not a Scheme compiler, but your idea is also cool. The WASM API apparently doesn't need a pre-made file as its input: you can pass raw bytes generated during runtime into the Module constructor, so it would be totally feasible.
- davexunit 3y agoWhen we have the compiler running in Wasm we'll post about that, too. That's the dream.
- pankajdoharey 3y agoSomeone actually wrote a scheme back in 2017 https://github.com/google/schism https://github.com/google/schism so this isnt new. Infact the whole idea of WASM is not new, 20 yrs back Sun had the same idea, embed compiled bytecode inside browser called applets, developed in JAVA. Even flash was a similar idea, though flash VM was riddled with security flaws. This failed to gain wider acceptance, now 20 yrs later we have a embedded bytecode compiler in the browser, but it may work this time.
- pankajdoharey 3y agoExplain why you downvoted this? Self hosting scheme compilers on WASM is not new. HN a compliance Ghetto?
- tmtvl 3y agoI don't know why you've been downvoted, I've given you an upvote for linking to an interesting project (even if it's linked in some way to Google). I'd also like to link to the updated GH link: <https://github.com/schism-lang/schism https://github.com/schism-lang/schism>.