News for hackers. Stuff that matters.

XS Programming Language

Made my language called XS. It's a general-purpose language, currently at v1.2.15 as of this writing. Would like feedback and how I can improve it! Website it at https://xslang.org. There is a playground to try XS out in, and fully complete docs as well. Enjoy!
( 16 comments | 4 points | on HN )
Re:XS Programming Language by dnnddidiej on Friday May 15, 2026 @05:26AM (#48146408)
Very cool. Since you have memoize ... does that mean all values are immutable?

Like the built in decorators. I think language design based on what people want to achieve rather than creating the most generic zoo of primitives is underexplored. So this is good.

Re:XS Programming Language by tacostakohashi on Friday May 15, 2026 @08:22AM (#48147724)
Language design based on what people want to achieve: that's basically what php, perl, python, visual basic... many others are/were.

It works pretty well!

Then... what people want to achieve changes, maybe they want to write a web app instead of desktop, and then you're screwed. Perl was excellent when everything was text... but when things started being XML or JSON or whatever, less so.

It's a fair point though, languages built around practicality have their place.

Re:XS Programming Language by Panzerschrek on Friday May 15, 2026 @01:07PM (#48151138)
Does it have destructors? Is is memory-safe?
Re:XS Programming Language by sheept on Sunday May 17, 2026 @04:51AM (#48167156)
Just a quick search through the docs, it's garbage collected and has no means of directly manipulating memory, so it seems to be memory safe
Re:XS Programming Language by banner521520 on Friday May 15, 2026 @09:30PM (#48155962)
Does your playground support astrocarto-style coordinate mapping? Would be cool for location-based data.
Re:XS Programming Language by arendtio on Sunday May 17, 2026 @05:03AM (#48167218)
So how does it compare to

- JS

- Go

- Java

- Python

I think adding a page about that in the docs could help evaluate the language.

Re:XS Programming Language by nexthash on Sunday May 17, 2026 @05:11AM (#48167264)
Of all languages to implement the XS toolchain in... why did you choose C?

Afaic this is DOA, there is no excuse in implementing the core toolchain of a new language in a memory-unsafe manner in 2026.

Re:XS Programming Language by ShinTakuya on Sunday May 17, 2026 @05:29AM (#48167360)
Plenty of valid reasons to pick C, memory safety isn't a reason to trade off all other possible benefits. One big reason is portability, you can't compile Rust for example for certain targets.
Re:XS Programming Language by spacedcowboy on Sunday May 17, 2026 @05:18AM (#48167298)
S'funny - I just used Claude to help me make a more-modern language[1] for the Atari 8-bit than the assembly/Action!/C that I've been using up until now

1: http://atari-xt.com/ (I really ought to get on that SSL cert, I guess)

Re:XS Programming Language by eps on Sunday May 17, 2026 @05:20AM (#48167317)
Well, great.

How does it compare to others?

Is it C with bells and whistles?

Is it C++ with blubber removed?

How is it different from D?

From Go?

...

Trying to fish out from a multi-page reference what makes your language unique and what gripes with other languages it solves is tedious, very few people would do it. It's on you to explain it.

Re:XS Programming Language by mapcars on Sunday May 17, 2026 @05:25AM (#48167345)
Are there any new features/improvements compared to established languages? For me its interesting to see how new languages explore new ideas, which don't exist in the mainstream yet.
Re:XS Programming Language by delian66 on Sunday May 17, 2026 @05:39AM (#48167410)
On the homepage, you have to change: `git clone github.com/xs-lang0/xs && cd xs && make` to: `git clone https://github.com/xs-lang0/xs && cd xs && make`
Re:XS Programming Language by citbl on Sunday May 17, 2026 @06:19AM (#48167601)
Impressive work. There is a ton of work done in there.

You can improve it by giving a reason for people to want to adopt it. That is bring novel ideas and push the envelope.

As is, it's a very impressive homework.

How's FFI with it? Can we just link any C lib?

Re:XS Programming Language by 000ooo000 on Sunday May 17, 2026 @07:23AM (#48167906)
Wow this is packed with features and looks great. Usually I skim through the docs for new langs waiting to see the design decision that makes me think "whyyyyy", but I think the most jarring thing for me here was really only the {- -} block comments. #, // and /*/ are ubiquitous and (IMHO) very unoffensive. @OP, any particular reason you opted for {- -}? No hate, just curious

xslang.org also looks great and I found the text in the guide + docs to be easy to read. I usually have to read C#/TS docs, so it was refreshingly terse.

Re:XS Programming Language by HeavyStorm on Sunday May 17, 2026 @09:58AM (#48168975)
Looks really cool. My main advice is: you must tell us why choose xs. It's cool but I saw no killer feature that would push me from go or python to it.

What does it do differently? What problem it solves that other languages don't?

Also, performance numbers. This looks highly complex and I worry that your C backend would underperform similar code in other languages. So let's us know.

Re:XS Programming Language by HeavyStorm on Sunday May 17, 2026 @10:05AM (#48169036)
Oh god why:

> String methods cover case conversion, trimming, searching, splitting, replacing, padding, classification, and parsing. .len() counts Unicode codepoints, not bytes; use .bytes().len() for raw byte length. Indexing with s[i] works in bytes; negative indices count from the end and out-of-bounds returns null. Several methods have aliases: .find() / .index_of(), .ltrim() / .trim_start(), etc.

Indexing uses bytes and len uses codepoints? Are you mad?

weirdUnicode[weirdUnicode.len()-1] returns random char?

And a = "a"; a[1] is null??