r/ProgrammingLanguages • u/jumpixel • Feb 28 '26
Nore: a small, opinionated systems language where data-oriented design is the path of least resistance
I've been working on a small systems programming language called Nore and I'd love some early feedback from this community.
Nore is opinionated. It starts from a premise that data layout and memory strategy should be language-level concerns, not patterns you apply on top, and builds the type system around it. Some systems languages are already friendly to data-oriented design, but Nore tries to go a step further, making DOD the default that falls out of the language, not a discipline you bring to it.
A few concrete things it does:
- value vs struct: two kinds of composite types with one clear rule. Values are plain data (stack, copyable, composable into arrays and tables). Structs own resources (hold slices into arenas, pass by reference only, no implicit copies). The type system enforces this, not convention.
- table: a single declaration generates columnar storage (struct-of-arrays) with type-safe row access. You write
table Particles { pos: Vec2, life: f64 }and get cache-friendly column layout with bounds-checked access. No manual bookkeeping. - Arenas as the only heap allocation: no malloc/free, no GC. The compiler tracks which slices come from which arena and rejects programs where a slice outlives its arena at compile time.
- Everything explicit: parameters are
reformut refat both declaration and call site. No hidden copies, no move semantics.
The compiler is a single-file C program (currently ~8k lines) that generates C99 and compiles it with Clang. It's very early: no package manager, no stdlib, no generics. But the type system and memory model are working and tested.
I'm mostly curious about:
- Does the value/struct distinction make sense to you, or does it feel like an arbitrary split?
- Is the arena-only memory model too restrictive for practical use or it could be considered just fine?
- Is a language this opinionated about memory and data layout inherently a niche tool, or can it be safely considered general-purpose?
- Anything in the design that strikes you as a red flag?
Happy to answer questions about the design choices.
23
u/GregsWorld Feb 28 '26
Language looks cool, the readme is not a place for error codes however, you should really open with a sample snippet to sell it.
9
u/vanderZwan Feb 28 '26 edited Feb 28 '26
I would have to play with the language to know how it is in practice, but the premise of building a language with specific affordances to encourage data oriented design has crossed my mind as well. So curious to see how your language "feels"
Have you ever looked at so-called scheduling languages? I feel like they're an interesting "other side of the same coin" in this domain. namely, data layout and how to access/iterate over that data.
Maybe you'll find some ideas in there relevant to questions you have about your own language.
https://halide-lang.org/
https://exo-lang.dev/
https://arxiv.org/abs/2411.07211
6
u/esotologist Feb 28 '26
I like it, we need more data oriented languages... Im planning something similar but with less keywords and more symbols to keep the focus even more on the shape of the data
5
u/Laicbeias Mar 01 '26
Its nice to see more data oriented languages. Ive done performance tests in c# today, to try out all possible access patterns. And yeah i asked myself exactly this. Why didnt c# make structs easier.
Anyway. Im not super sure but.. id make base types int short float etc passed around by copy on the stack. and anything thats a struct passed by ref. Implicit. with a "copy" if you want to copy it.
Make the common case simple. Actually i think your design is good. Just make it not too annoying to manipulate data.
Like i can see why you have value and structs. Its just.. id rather explicit write copy than ref everywhere. Or rather have one default behaviour.
Just test the performance of how it all behaves. Copy can become expensive. Like copy a vector4 in a function is more expensive than a ref. And if you have large columns with lots of accessed fields SoA can fall off a cliff.
Otherwise i hope such languages get more traction, we really need to have data oriented design as first class citizen
4
u/AustinVelonaut Admiran Feb 28 '26
In your README:
valuetypes are plain data: they live on the stack, copy freely, and compose into arrays and tables.structtypes own resources: they hold slices of arena-allocated memory, pass by reference only, and cannot be copied. No hidden allocations, no implicit clones.If
structtypes cannot be copied, how do you pass a modifiedstructto another function, but not modify the originalstruct? Do you have to explicitly deconstruct the struct into itsvaluecomponents, then create a newstructfrom those each time?4
u/Toothpick_Brody Feb 28 '26
I’m also working on a data-oriented language, but it’s a major WIP, so take these with a grain of salt.
Value/struct - personally, I’m trying to unify structs/values/arrays/functions. A strict distinction isn’t necessary if you can classify them by structure. But it seems like your struct has more to do with memory management than arranging data? The distinction might be worth it if you find the ref-only semantics of structs useful.
Arena-only memory - I’m also trying this model. I think it will be fine, but I can’t give a solid answer unfortunately
Explicit copy/ref semantics - I’m also doing this. Afaict it’s a good idea. Java annoys me with its implicit boxing
4
u/yuri-kilochek Feb 28 '26
One should be able to group fields of a table into AoS storage. SoA is fine as default, but it doesn't fit all access patterns.
3
u/XDracam Mar 02 '26
I like the idea and the language actually looks pretty good syntactically (which seems rare for some reason)
But I don't understand the distinction between values and structs. I am sure you are solving an actual problem that people have, but you need to communicate that problem properly. Otherwise it seems to be too restrictive without an obvious reason.
It'd also help to see a more complex example of arrays and tables, e.g. the struct and value generated by a
table.On that note: generating a
FooRowmagically seems to be against the idea of being fairly explicit. It also hurts tooling and might be confusing for an LLM agent (which is a concern these days...), not to talk about people who want to have e.g. a domain typeFooRowthat maps to a relational DB instead of a table. So why not something likeFoo.Rowinstead?3
u/Dan13l_N Mar 04 '26
"Struct holds a slice". How can the compiler know if somewhere there's a
structthat holds a slice to an arena that's being removed? Or arenas are static?If all values are by-value, and all structs are by-ref, why do you need
refat all?5
u/matthieum Feb 28 '26
I don't think it's worth spending a keyword on. It feels like something an annotation could handle -- like Rust's
#[derive(Copy)].Depends how flexible the arenas are:
General-purpose is more about capabilities. If it's Turing-Complete it could be considered general-purpose... which doesn't mean people would use it.
tabledoes, as far as I understand it.It seems that
tableis just a fancy struct of vectors -- dynamically grown arrays -- which expects that if it contains N elements, then elements are in [0, N).Much like arenas, it's not flexible enough. I may need a fixed-capacity design. I may need a "bitmap" design (ie, some holes in the middle). I may need to combine fixed-capacity and bitmap...
How to integrate SOA flexibly is a question to which I don't have an answer. I just know, as a system developer, that
tableis NOT the answer I'd be happy with. Too restrictive.Philosophically, I prefer "open" languages, which give me the tools to build what I need, rather than offer one "blessed" tool and tell me to live with it.
Hence, I don't like Nore, and would not use it.
2
u/JeffD000 Squint Mar 02 '26 edited Mar 02 '26
it's not arbitrary, but it is just as inflexible as having a purely column-oriented database. Ideally, declaring a Point of "struct { double x, y, z; }" would not require extensive code changes to switch to a Point of "struct { struct { double x, y; }; double z; };" Ideally, only the one declaration statement in the whole file would need to change to switch between these two implementations.
Arena oriented data is preferred for muliple fields within a topology of a given cardinality. Using the malloc() approach independently for each field is garbage, if you care about the performance of the memory hierarchy.
As implemented, it is niche, due to its inflexibility. It can be easily generalized to make it widely applicable. You are close!
No red flag. It's an improvement on what came before it.
That said, it can be further extended to make it more widely useful. As written, there is no support for hierarchical subsets of data. What you have implemented is a flat data structure with a fixed cardinality.
As an example, in your model, there is no way to partition that flat data structure across multiple memory channels if you want to have parallelism without memory space bandwidth limitations. That's not a criticism, that's just a statement of the current simplicity, which may be exactly what you are shooting for. It is very easy to go from where you are at to a "full solution".
2
u/JeffD000 Squint Mar 02 '26 edited Mar 02 '26
This is how I would implement your program in an "ideal" data structure:
Your version:
My version, ad hoc (I've changed the keyword 'table' to View):
1
u/Relative-Rooster-945 Aug 15 '26
I find the naming of value/struct doesn't intuitively imply your intended semantics
-2
u/Arakela Feb 28 '26
Data layout, as the path of least resistance, is the right instinct.
We can convert any data into a step-by-step traversal-pluggable computation. In practice, it means that the data can have its own will and can act in interaction as a role. I discovered this model as a consequence of denial. Have developed a grammar VM that worked based on a DSL written on an array/tape, a standard VM interpreter model. But was denied with a message: "DSL sucks, I want my grammar in a language in which I write a compiler." "Why not write grammar in an actual programming language?", etc... I recognized, those are clogans someone blowing out and converted tape into computation. The step that helped me in this process is the typed step. When we use this tool to its extreme, we can only complete the step, close the type, and build a ground.
I found the step by considering the returnless programming only option. Thing I realized: with return, we are describing computation, as code, and the compiler turns the description into a sealed unit of computation. It wires all the jumps. So `return` is the statement, adored by language committees, monkeys typing sheckspire in your language. To go really wild, type a step is like a wire, and the structure is the ultimate type forced by physics. No floating-point register can receive an integer instruction it is not wired by type step.
The step is fundamenal unit of composition.
Below is the TM specification in systems language (C in asm):
Below is the purest form of a formal step-by-step traversal-pluggable grammar (C in asm):