News for hackers. Stuff that matters.
Re:Wisp: A light Lisp written in C++ by bjoli on Monday December 28, 2020 @10:31AM (#25559931)
Of course it is. A friend of mine wrote a C99 interpreter in python in high school. He had the wonderful idea of not implementing any undefined behaviour that wasn't strictly necessary :) we used it to test our C code later on in the course.

It probably won't be very fast though. There are parts of C++ that doesn't map very well to common lisp, and which means some parts will have more overhead than necessary.

Re:Wisp: A light Lisp written in C++ by MaxBarraclough on Tuesday December 29, 2020 @07:15AM (#25569023)
Very impressive for a high-schooler.

> He had the wonderful idea of not implementing any undefined behaviour that wasn't strictly necessary

What does this mean? It sounds like the way an ordinary C compiler works: it ignores the possibility of undefined behaviour occurring, as the C standard allows it to do this.

Re:Wisp: A light Lisp written in C++ by bjoli on Wednesday December 30, 2020 @06:16AM (#25580745)
I just remember that it crashed if you tried to modify a string literal, which IIRC is undefined. And that it was very diligent about scope.

If you had signed integer over/underflow it wrote insulting error messages.

Re:Wisp: A light Lisp written in C++ by sillysaurusx on Monday December 28, 2020 @10:57AM (#25560163)
C99, sure. C++?
Re:Wisp: A light Lisp written in C++ by bjoli on Monday December 28, 2020 @11:49AM (#25560688)
Of course it is doable. Nontrivial of course. C++ is probably not the language I would start with.