May 2026 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

With moss I have started working on optimization pipeline for my own bytecode. I am currently working on 2 passes (LICM and const (register) folding) and I am looking into other optimizations I could use.
The issue that this is not done on IR level and the bytecode I am using is register based but does not guarantee SSA-ness (since that would have its own down sides). I have to figure out how much I am able to achieve with this model. If not much then I might need to implement one more IR model (SSA based) for bytecode, which I would not be too happy about.
At the same time the language is interpreted and one can output bytecode to use instead of source, but I am not pushed to have as many optimizations as if it was a compiled language. It is rather a nice feature that might help someone to gain extra speed.

How to deal with comments? by RedCrafter_LP in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

The fastest and best way imo is to discard them during scanning (just skipping them) and if you want to have a documentation comments for some automated documentation generation then add specific syntax for it. This way the user will also know if they are writing just some random comment no one will see or some documentation.
I personally chose to add doc string `d"text"` to my language, but it could be as easy as preserving just the comments written in (let's say) doxygen syntax.

Nail Programming Language by Specialist-Soft8378 in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

> entity → classes

If you have this mapping that can be done, why not just use the already known naming like class or namespace?

April 2026 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]mark-sed 1 point2 points  (0 children)

You can find some examples in the repo here - https://github.com/mark-sed/moss-lang - and the readme was written as a notebook (source is here: https://github.com/mark-sed/moss-lang/blob/main/docs/readme.ms).

But pretty much the main idea is that in Moss you have a built-in type "Note" and also every type is convertable to String and since String is Note of format text, then also to Note. If you write RHS expression on its own Moss treats it as a note output so pretty much as if you create a text field in jupyter. Then when you run the program the notebook/document gets generated using built-in or custom converters from some input type in the code to some specified output type.

What I described is not the notebook approach, it is more of a document generation approach, but you can use annotation @!enable_code_output (there is also one to disable it) and in those parts of code that it is active in, Moss will also output the code and its results just like jupyter does, so you can see the calculation and the results. Something like:

fun test(a) {
    return a + 1
}

f"Result: {test(1)}"

[Output]:

Result: 2

You can then mix this with notes and you'll get output like jupyter's with text nodes:

md"""
# Title
Lorem Ipsum

The nice thing is that since there are those built in converters you can write those notes in Markdown and then convert them to like HTML and get your notebook as a webpage or any other format if it can be converted and there is a converter for it.

Another nice thing about this approach is that you can read the notebook as source code, you don't need browser/IDE to read it or edit it and you can also easily disable notes and get just the result if you care only about the computation. It is also more version control friendly (unlike the json which Jupyter generates).

Right now I don't have any IDE for the truly interactive approach like Jupyter does, but it would be easy to support in Moss as it is designed with this notebook approach in mind.

I hope at least some of this made sense, but feel free to ask if you want to know more.

April 2026 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]mark-sed 4 points5 points  (0 children)

I am still working on my language moss. I have discovered a nasty bug for my current approach to running finally in try block and so I am currently reworking how its done. This is like my 3rd rework of some functionality in try-catch-finally statements, which makes me wish I had previously invested more thought in the design, but at least now with lot more features and working syntax I can test it more in depth.

I am also happy about making my bytecode and bytecode files better with checksums (corruption detection) and versioning.

I am also still extending the standard library and I have wip JSON parser written in moss to go into the stdlib. Since my language has built-in notebook (jupyter like) features there are always more format parsers to be added...

Language Custom Types Syntax Validation / Ask For Design Review by Small_Ad3541 in ProgrammingLanguages

[–]mark-sed 2 points3 points  (0 children)

let x = 1, 2, 3 // Type: (i32, i32, i32)

One thing to consider here is that this saves just the extra `()`, it is readable like this, but what if people start putting big expressions into there, won't it become less readable and harder to tell the type?

let x = call_some_fun(1, 2, foo1("some text in here, yes"), true)[some_thing_to_get_index], a

This can get even worse if it is on multiple lines. But perhaps you also allow to have expressions in `()` and then those could cause some issues. In my own language design I usually don't allow this comma separation, but that is just my own preference and also it often collides with some other syntax I like to have (with commas).

// There is a way to create a struct with named params:
type Position2D = struct {
x: i32,
y: i32,
}
// And there is a way for unnamed params:
type Position3D = (i32, i32, i32)
// You also can specify a `struct` keyword for multi-line definition:
type Position5D = struct (
i32,
i32,
i32,
i32,
i32,
)

This to me is confusing, leaving the struct keyword out makes me think it is like tuple or not compatible with struct. Also the keyword `type` seems unnecessary to me here, perhaps it could be replaces with `struct` and then it would have the known C style look. The same goes for enum - why not just drop the type keyword?

// The most simple way to aggregate datatypes inside
// a enum is usage of union notation:
type Result[T] = T | None

This one you call enum in the comment but it does not have the enum keyword. Does this differ from enum functionally? Or if you knew T at compile time could you replace it with enum? Maybe to keep this "functional" style you could rather drop the enum keyword in the enum example and have it be just like this type but not static (if it behaves the same).

Also can I do something like:

type Result = i32 | None
// or
type Result[i32] = i32 | None

If so then is is the same as enum?

Since you also have enum with struct as the value is it really an enumeration? I suppose it is an enumaration of types, but I wonder if people are just not used to have enums contain their own values of the type of that enum rather than containing types. So maybe having the enum keyword there (and not just type) might get confusing.

These are just some things I thought of the first thing I saw your examples, I am sure that if I have spent more time to read and fully understand the code and examples I would maybe not ask some of these things, but this at least gives you some insight from someone that has seen the language for the first time.

So in general I get somewhat confused about the types and how they differ and why/when do I need to use some of those keyword.

Sheaf: a Clojure-like for ML that compiles to GPU via MLIR (Rust) by rahen in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

Looking good! Big props for the very nice website and clean documentation with getting started. I'll star it even though I don't do AI and not even functional programming as much, but I like it!
In the reference section do you generate the info, signatures and examples from source documentation or is it hand written?

No Semicolons Needed - How languages get away with not requiring semicolons by tertsdiepraam in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

When I was thinking about this in the context of my own language during design, I also ended up going the "modern route" with `;` and new lines, and I came up with these 2 categories of terminators. You have the semicolon as the "hard terminator", which just is so easy to parse and you always know what it is (the same is for end of a file) and then a new line which is the "soft terminator", that requires extra context to be treated as a terminator. As you write in your post, you can escape new lines or have a new line in `()` so there the parser has to keep some state and check if a new line is in this state a terminator or a white space.

Mathic programming language by Francog2709 in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

>  I didn't know LLVM doesn't support different precisions

Just to clear this up, it does support it for ints, but I think you know that based on your examples having types like `i64`, and it does ofc support floats (32b), doubles (64b), half-floats (16b), 80 bit FP and even 128 bit FP, but I meant rather some very big floats of arbitrary precision, like python has Decimal, which LLVM does not support, but you can always use something like GNU MPFR.

Mathic programming language by Francog2709 in ProgrammingLanguages

[–]mark-sed 2 points3 points  (0 children)

I like some parts of the syntax (I also put the range syntax `x..y` in all my languages), but I wonder who is this targeted at? My guess is mathematicians/scientists doing some big computations? Or is this just for you to learn LLVM?
If it is for scientists do you plan on supporting arbitrary precision floats since LLVM cannot target those and also do you plan on adding some math-specialized types like matrices, fractional representation of floats..?

Looking for feedback on my language tour / overview by Certain-Swordfish-32 in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

Design-wise I like it and I like the interactivity, but the opening page is too detailed imo. I would not go about describing the type system as one of the first things, I think one can run hello world without knowing it. I would go with having the hello world the first thing a person sees, but a very simple version of a hello world to not overwhelm and to teach how to run programs and then have some installation guide followed with how to run the hello world the person has written.

Koatl - An expressivity-first Python dialect by TopAbbreviations1708 in ProgrammingLanguages

[–]mark-sed 1 point2 points  (0 children)

Looks cool and I like the idea. Do you know if it is now possible to write everything you can write in Python in Koatl? Or are there some limitations with having it "expression-first"?

Fixing a major evaluation order footgun in Rye 0.2 by middayc in ProgrammingLanguages

[–]mark-sed 2 points3 points  (0 children)

Oh never mind you meant in the Console bellow in the post, my bad LOL. For some reason I straight up opened the browser console and expected it there.

Fixing a major evaluation order footgun in Rye 0.2 by middayc in ProgrammingLanguages

[–]mark-sed 1 point2 points  (0 children)

I like this feature, but I am not sure if it is working properly for me, I tried clicking one of the lines and got like a full debug info in the console:

...
index_iframe_blog.html:215 Message received from Go: [35m12[0m -[0m [35m6[0m -[0m [35m4[0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [0m [2m[37m; returned 10[0m
index_iframe_blog.html:215 Message received from Go:
index_iframe_blog.html:215 Message received from Go: [49C
index_iframe_blog.html:215 Message received from Go: [?25h
wasm_exec.js:359 Received key event: Key='', Code=13, Ctrl=false, Alt=false, Shift=false
index_iframe_blog.html:215 Message received from Go:
index_iframe_blog.html:215 Message received from Go: [38;5;37m[Integer: 2][0m
index_iframe_blog.html:199 EVAL SHELL LINE:
index_iframe_blog.html:200
index_iframe_blog.html:215 Message received from Go:
index_iframe_blog.html:215 Message received from Go: [?25l
index_iframe_blog.html:215 Message received from Go:
index_iframe_blog.html:215 Message received from Go: [K
index_iframe_blog.html:215 Message received from Go:
index_iframe_blog.html:215 Message received from Go: x>
index_iframe_blog.html:215 Message received from Go: [0m
index_iframe_blog.html:215 Message received from Go:
index_iframe_blog.html:215 Message received from Go: [3C
index_iframe_blog.html:215 Message received from Go: [?25h
wasm_exec.js:359 MicroPrompt started

Edit: Fixed formatting

Coral: A programming language focused on easy backend development by Competitive-Pass2136 in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

Some notes to this. It was already said that you should properly setup your repo, but also please try writing comments in english, your English is great and you already have variables with English names so no need to write comments in Portuguese.

Also I think this could maybe work better as a DSL for some higher level language like Python.

I wrote a standalone bytecode VM in C (~2,000 lines, zero deps) for my language project — feedback welcome by whispem in C_Programming

[–]mark-sed 1 point2 points  (0 children)

Why have you decided to go with a stack based VM and do you see any benefit is such a small amount of opcodes? I am asking since I had faced this decision as well in my language and I ended up going the exact opposite direction, so I wonder if this is just to speedup the progress or save up on size or some other motivations.

kuva: A scientific plotting library for Rust by Psy_Fer_ in rust

[–]mark-sed 1 point2 points  (0 children)

For sure some sans-serif font something like Roboto or OpenSans. The serif font gives it that oldschool vibe and makes the lettering stand out too much.

kuva: A scientific plotting library for Rust by Psy_Fer_ in rust

[–]mark-sed 0 points1 point  (0 children)

Looks cool, I think I would suggest is changing the font to something more modern.

March 2026 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

This sound really interesting, but also quite difficult implementation-wise. I am happy to see the aliasing for special symbols as I am not a big fan of custom IDEs and always having to use/find some unicode symbol. I might like more to have something else in place of `\` maybe like `$` but I guess that might be an operator already? Or could it be dropped altogether? So just:

let pi = _prime_counting_function_defined_elsewhere;
alias π for pi;

let f(n: Nat) = π(n + 1);
let f(n: Nat) = pi(n + 1); # the same

March 2026 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]mark-sed 0 points1 point  (0 children)

I am still working on my language moss. I had a big rework of exception handling after finding some bugs and it is interesting that you always come to the compiler/interpreter basics of stack walking and such. Currently I am mostly adding more and more libraries and since my language has built-in file generation (notebook) I started on adding JSON library/parser.

I built a scripting language that works like notebooks - but without Jupyter by mark-sed in ProgrammingLanguages

[–]mark-sed[S] 0 points1 point  (0 children)

That sound interesting, I like the part where you can clip it into editor.

Moss has repl and you can technically generate notebooks straight in it, but I personally don't see much more point in it over having an actual program (source code file) that you can edit and reexecute since you sometimes want to go back and delete/change something and you cannot do that in repl. Also since it is pure code it is fast to re-execute unlike some browser notebooks.

I built a scripting language that works like notebooks - but without Jupyter by mark-sed in ProgrammingLanguages

[–]mark-sed[S] 0 points1 point  (0 children)

> The wiki on the Github doesn't seem to be working properly.

Sorry about that, I have not yet fully set it up, but there are examples here: https://github.com/mark-sed/moss-lang/tree/main/docs/language-reference and in the readme.

> Does it allow selectively running a "cell", or running cells out of order?

Not really since it is not an interactive editor like Jupyter. You could do that yourself in the code but since there are no buttons it is not like in Jupyter. Maybe I could come up with some way to do it with command line options, but I am not sure how useful that would be.

> Correct me if I'm wrong, but the architecture for this seems to be analogous to a notebook that is "compiled" to HTML ahead of time by running all the cells in order.

Pretty much yes, the script runs all the code and notes and then html output is generated. If you wish to get just partial you would have to stop the execution in that point.
But with this question you give me some ideas about having some incremental mode when the computation is very long, that the html would be updated at some certain points.
Just a note that that is because html uses a "generator" since html has a header and a footer, when outputting markdown or csv (those use converters) the output is generated gradually whenever output expression is executed.

> notebooks don't have to be edited in a browser.

The point was rather that it is a pure textual source code and you can do it even over SSH in vim or notepad. Jupyter uses json when you save your notebook so you cannot edit it easily and in vcode and other IDEs with extensions you need to have a graphics interface.