At one point, the author may have written a fair bit of code by hand (starting with a Crafting Interpreters project, and then adapting it recently using agents?). The commit history is very confusing.
The design of the VM is nearly identical to the clox interpreter in Crafting Interpreters. There's also a bit of Lua inspiration mixed in the instruction encoding.
Who is this language for? Who is the audience, and what does the author intend to convey to them?
There's a ton of features -- are they used consistently? We have function overloading and traits. We have optional type annotations and effects -- the effects are handled with a (fragile) multi-shot continuation implementation (at least copy Leijen or libmprompt! that code is out there, free to use, and robust!)
There are two parallel type inference systems in `src/types`. The type system which the language actually uses is not consistent yet (see e.g. `inference.c`: "recursive type: bind anyways")
With that being said, I'd take the cross platform claims with an extreme grain of salt ...
/* generalize: check if vars in t are free (not bound in env).
For now, a simplified version that just returns the type as-is. */
CkType *ck_generalize(CkTypeEnv *env, CkType *t) {
So the identity func (id x = x) stays a monotype?Also, I'm not seeing any more or less safety in this code than the surrounding code:
/* thread-safe version that returns allocated string */
static char *type_to_str_alloc(CkType \*t) {
char buf[512];
type_to_buf(t, buf, sizeof buf);
return xs_strdup(buf);
}
Are multiple type-checking threads blasting through this at the same time?The most interesting claim that this file makes is that it does HM-inference as well as subtyping. I'm smart enough to parrot "that's undecidable" even if I'm too dumb to know why.
HM is hard enough without taking the sizeof pointers and mallocing every few lines.
Oooof brutal. I agree it is remarkable people release stuff like this.
Very impressive if I'm wrong (hopefully some of the comments help you prune some of these smells, if you wish)
Given that it's written in C (and assuming it actually compiles), I'm likely to believe the cross-platform claim.
Here's an example https://github.com/adriaandens/XSamples/blob/master/XSamples...
There are a lot of words related to language design like tree walk interpreter, algebraic effects, and semantic analyzer. But no real content about the language design, motivation, or what distinguishes it from other languages.
Also strange to start of the language introduction with an entire page dedicated to comments and how white space is handled.
If this was written by a human, I how it is taken as constructive criticism to consider what key points you want to convey before people bounce off of a page.
On the website, the standard library lacks a table of contents, but you can see what it has here:
https://github.com/xs-lang0/xslang.org/tree/main/src/app/doc...
It's like busybox, which is unremarkable as Unix userland, but is interesting because it's a single small binary.
But beyond the standard Algolish stuff, XS seems to have quite a few modern niceties, such as traits, generics, closures, OOP, pattern-matching, and even algebraic effects.
Every other piece of
* the old tier-1 dispatch JIT (the ~1500 lines of per-opcode helpers,
* the jump-table dispatcher, the jit_rt_* runtime shims) was deleted
* because benchmarks showed tier-2 dominated on every workload that
* reached the JIT at all. */
No human cares about including such an irrelevant detail as the lines of code in helper functions. Obvious LLM context spew, obvious AI slop project. Please stop posting things you didn't bother actually working on.I can only speak for myself, but I'm not going to use the precious time I have alive wading through the mountains of schlock that LLMs can spew out looking for anything of value. I'm interested in things a human wanted to spend their finite time doing instead of something else.
Human effort signals value, AI does not.
Human effort is often inviting collaboration. AI rarely does.
Then, what if ai will write something cool/good/interesting/high quality/amazing?
At this point, it doesn't really matter what the language does, because the author and I have mutual respect. There is none.
Too bad that agentic world basically destroyed all programming languages that are not Python, Typescript or Rust.
Tells me all I need to know. Signalling my intent to call this garbage.