Golden

Systems & Software

<- Compiler

Webcorn ->

Language

The language can be called GDSL, Acorn_script, or Q-Script, I often refer to it as Acorn_script to remove confusion with GDSL the project.

It is really just the registration of handlers to the compiler, and the boundary between the two is quite fuzzy, don't take the way I arrange my code as gospel if you read it.

testssource

Basics

Acorn_script shares most of its basic syntax with C, brackets, braces, parens, semicolons, standard control flows, variable declarations, types, etc...

Strings, locking, and data structures all come from the Acorn memory model rather than a standard library.

There are various logging, debugging, and other standard library utilities baked into the language itself, since I prefer C++ interop and performance over philosophical purity at this stage.

My intent is not to make some exotic language: the syntax of C or JavaScript or Python are all proven UX, I just don't subscribe to their underlying implementations.

I believe duck typing and high level syntax shouldn't require giving up control over memory, and that the memory model should know what's in it rather than the pointer.

Precompiling blocks

The two hashes (## ##), this code executes during the tokenizing stage.

Values can be passed out with the global qual, since precompiling blocks exist before any normal scopes in which a variable could be declared.

Homoiconicity

Acorn_script is fully self modifying (including the compiler), since each handler can just be a Ptr to a scope in the langauge.

Register and newstage are keywords used to register new types and stages.

A string with a scope is a node block, used to register behaviour via on and in which add overloads and stage behaviour respectively.

Nodes, Values, and Contexts are also native to the language, like every other data type with a layout. Inside an on or in handler the context is accessed with the ctx keyword.

YAPA

YAPA means Yet Another Ptr Alias, and it's where most of the high level syntax in Acorn_script lives.

Any type which is really just an interpretation of Ptr can be registered as a YAPA type with a level, this gives it overloads telling it which level of its Ptr is the important one.

As an example: a YAPA-1 Ptr refers to a Col, the important field is slot (sidx). If you called .get on a YAPA-1 you would move the slot. A YAPA-2 refers to a ColCol, .get would give you a YAPA-1 Ptr by moving the column (idx) field.

YAPAs can also be indirect, meaning they are a YAPA-1 of Ptrs which should be resolved an additional time on gets and such. Object is one of these, which is why it can have different properties without a layout.

Locking, database operations, and general data structure work all go through the YAPA interface.