Scheme in Scheme on WASM in the browser
spritely.institute
spritely.institute
The current form is too low-key since it looks like a screenshot.
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
To illustrate, the following code causes a stack overflow for me in both Google Chrome and in Node.js, but runs without issue in Safari.
"use strict";
const countdown = (n) => n == 0 ? console.log('done') : countdown(n-1);
countdown(100000);I personally had the opposite experience on this one. I had always been told that V8 was a highly efficient JavaScript engine, so I didn’t really worry about writing recursive functions to which I had assumed such a fundamental optimization would be applied. After all, TCO will take a recursive call that would have O(n) space complexity, where n is the recursion depth, and evaluate it in just O(1) — it didn’t seem possible that a highly optimized JavaScript engine would miss something so fundamental. I was both surprised and disappointed when I found out I wouldn’t be able to safely use recursion in JavaScript code that would run on Google Chrome, Android, or Node.js, unless I could guarantee a relatively small depth.
If it's inconsistent, then people write a lot more tail calls and a lot more sites break on a lot more devices.
It doesn’t add up if V8 is withholding TCO under the guise that it would cause programmers to write stack overflow bugs unless a new proposed keyword for it gets added to the language. The truth currently is that V8 itself has a stack overflow bug in its omission of TCO, it wouldn’t be right to shift the responsibility for that to the JavaScript programmers. But you’re right, unfortunately the JavaScript programmers are the ones who have to deal with the consequences of V8’s spec non-compliance which causes the stack to overflow when it shouldn’t.
* Internet Archive's Democracy's Library https://blog.archive.org/2022/10/19/announcing-democracys-li...
* Distributed Press https://distributed.press/
* Guardian Project https://guardianproject.info/
* MuckRack Document Cloud https://muckrack.com/
* Harvard Library Innovation Lab https://lil.law.harvard.edu/
* Human Rights Data Analysis Group https://hrdag.org/data-publication/
Longer list here: https://ffdweb.org/explore/#partners
What's some evidence of this trend you can think of?
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.
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...
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.
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.
I see no problem with that. That's not what university should be about. They're not supposed to be software dev bootcamps for companies.
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.