#langdev — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #langdev, aggregated by home.social.
-
I also have messed up the VM stack, probably because removing a CALL instruction is a bit more involved and you need to remove the associated PUSH_RETURN_ADDRESS (first, push the addr, then the function, its arguments, and finally call it ; that way the stack is correctly setup once you hit a RET instruction and we know where to go back to)
Seems like it’s more complicated than that, even if I avoid using LOAD by index instructions, because the stack is still broken.
The inliner itself is very dumb: remove the CALL and replace it with the function body (minus the RET instruction). Of course this overwrite variables, but I can fix that later.
I must be missing/forgetting an important piece of information about how the VM expects a CALL to go…
Until we meet again!
#pldev #ArkScript #langdev -
I also have messed up the VM stack, probably because removing a CALL instruction is a bit more involved and you need to remove the associated PUSH_RETURN_ADDRESS (first, push the addr, then the function, its arguments, and finally call it ; that way the stack is correctly setup once you hit a RET instruction and we know where to go back to)
Seems like it’s more complicated than that, even if I avoid using LOAD by index instructions, because the stack is still broken.
The inliner itself is very dumb: remove the CALL and replace it with the function body (minus the RET instruction). Of course this overwrite variables, but I can fix that later.
I must be missing/forgetting an important piece of information about how the VM expects a CALL to go…
Until we meet again!
#pldev #ArkScript #langdev -
I've finally started work on an IR inliner for #ArkScript, and so far, I think I have found a decent heuristic (that **will** get tweaked once everything is in place)!
Inline only
- non recursive functions,
- simple functions (calling only builtins and operators, no other functions),
- non closure functions,
- functions that don't instantiate closures,
- functions with a relatively low instruction count (arbitrarily chosen to be 24, for now)Except for some load symbol/load symbol by index shenanigans, I don't see what could go wrong
-
I've finally started work on an IR inliner for #ArkScript, and so far, I think I have found a decent heuristic (that **will** get tweaked once everything is in place)!
Inline only
- non recursive functions,
- simple functions (calling only builtins and operators, no other functions),
- non closure functions,
- functions that don't instantiate closures,
- functions with a relatively low instruction count (arbitrarily chosen to be 24, for now)Except for some load symbol/load symbol by index shenanigans, I don't see what could go wrong
-
@ireneista Kittyscript's first complex thing was continuations (in an implementation language without support for them or tail calls), implemented by tracking my own stack
the most relevant class is KsEngine.
#Kittyscript #LangDev -
@ireneista Kittyscript's first complex thing was continuations (in an implementation language without support for them or tail calls), implemented by tracking my own stack
the most relevant class is KsEngine.
#Kittyscript #LangDev -
CW: (Lack of) Kittyscript development progress
I haven't written any code for Kittyscript last weekend or this weekend yet.
Last weekend I was doing parsing research that involved starting to reimplement the parser system from Proto-Kittyscript and a similar parser I wrote at my wage job, but I ended up finishing that in the wage job codebase. The reimplementation in my personal codebase didn't even get far enough to replicate the previously existing code. I wanted to see if my parser system is fundamentally capable of handling left recursion with some tweaks. It does work but is slower in performance.
This weekend I was thinking about the Kittyscript compiler's flow, and whether to use a mutable or immutable structure for the compilation context. Advantage of immutable: could be interleaved with the parser for context sensitive parsing, because backtracked parse parts don't destroy the context. Advantage of mutable: Easier to understand how to use callbacks to respond to context changes after the location of the expression (Example: A variable or function is used before its declaration, so it can place a callback that will be invoked once a variable or function with that name is declared further down).
There's a nonzero but small chance I will write some code today still.
#Kittyscript #LangDev -
CW: (Lack of) Kittyscript development progress
I haven't written any code for Kittyscript last weekend or this weekend yet.
Last weekend I was doing parsing research that involved starting to reimplement the parser system from Proto-Kittyscript and a similar parser I wrote at my wage job, but I ended up finishing that in the wage job codebase. The reimplementation in my personal codebase didn't even get far enough to replicate the previously existing code. I wanted to see if my parser system is fundamentally capable of handling left recursion with some tweaks. It does work but is slower in performance.
This weekend I was thinking about the Kittyscript compiler's flow, and whether to use a mutable or immutable structure for the compilation context. Advantage of immutable: could be interleaved with the parser for context sensitive parsing, because backtracked parse parts don't destroy the context. Advantage of mutable: Easier to understand how to use callbacks to respond to context changes after the location of the expression (Example: A variable or function is used before its declaration, so it can place a callback that will be invoked once a variable or function with that name is declared further down).
There's a nonzero but small chance I will write some code today still.
#Kittyscript #LangDev -
I messed up a few years ago when adding list:find and similar functions to my language, #ArkScript
The language has a void value, nil, but those functions return -1 (as in C...)
Alas -1 is also a valid index in ArkScript (same as Python)I'm unsure about how to change that
The deprecate and change the type in the next release option seems "decent", but I feel like it's abusing deprecation warnings
-
I messed up a few years ago when adding list:find and similar functions to my language, #ArkScript
The language has a void value, nil, but those functions return -1 (as in C...)
Alas -1 is also a valid index in ArkScript (same as Python)I'm unsure about how to change that
The deprecate and change the type in the next release option seems "decent", but I feel like it's abusing deprecation warnings
-
Создание своего языка программирования на Rust #3: Парсинг стейтментов вывода и присвоения
Третья часть написания своего языка программирования на Rust с нуля: Парсинг первых стейтментов языка: вывод и присвоение.
-
Создание своего языка программировани на Rust #2: Парсер выражений
Вторая часть по понисанию своего языка программирования с нуля на Rust: Написание парсера для выражений.
-
Создание своего языка программировани на Rust #1: Лексер
Гайд о том, написание интерпритируемого языка с динамической слабой типизацией на языке Rust с нуля. Часть 1: Написание лексического анализатора.
-
@inautilo lol. I love it
-
@inautilo lol. I love it
-
-
-
Added syntax for maps to my language, and a handful of functions I commonly use.
There may be a couple more functions I want to add soon, but I'm happy with it for now.
Glad I've finally had some time over the past few days to get back into it :)
-
Added syntax for maps to my language, and a handful of functions I commonly use.
There may be a couple more functions I want to add soon, but I'm happy with it for now.
Glad I've finally had some time over the past few days to get back into it :)
-
quoting https://void.lgbt/notice/B3WFS9RT5V8b6XOfdQ
I did start with that yesterday, but didn't do it far enough to meet my personal standard for committing it into Git yet.
#Kittyscript #LangDev
RE: https://void.lgbt/objects/e0625ea8-45ef-4cad-a00f-b5882e265886 -
quoting https://void.lgbt/notice/B3WFS9RT5V8b6XOfdQ
I did start with that yesterday, but didn't do it far enough to meet my personal standard for committing it into Git yet.
#Kittyscript #LangDev
RE: https://void.lgbt/objects/e0625ea8-45ef-4cad-a00f-b5882e265886 -
https://lensplaysgames.github.io/LensorCompilerCollection/lcc.html
LCC Playground got updated again: we now have fix-it hints (try leaving out a semi-colon)! Also added functionality for more flags
#lcc #glintlang #compiler #programming #dev #langdev #lensor
-
https://lensplaysgames.github.io/LensorCompilerCollection/lcc.html
LCC Playground got updated again: we now have fix-it hints (try leaving out a semi-colon)! Also added functionality for more flags
#lcc #glintlang #compiler #programming #dev #langdev #lensor
-
Made my silly little programming language public:
https://github.com/ltriant/cliq
Nothing amazing about it. It's a dynamiclaly typed, functional-ish language. It's pretty slow for now. But it's a lot of fun to hack on, and I find it fun to write.
Named for my wife and kids, because they're fun too :bear_hug:
-
Made my silly little programming language public:
https://github.com/ltriant/cliq
Nothing amazing about it. It's a dynamiclaly typed, functional-ish language. It's pretty slow for now. But it's a lot of fun to hack on, and I find it fun to write.
Named for my wife and kids, because they're fun too :bear_hug:
-
Just wrote 1000 more words for my book about my novel #programming language, #glint!
https://github.com/LensPlaysGames/LensorCompilerCollection/blob/main/docs/glint/thebook.pdf
-
Features I put into Kittyscript today:
- Adapter functions to compose and reverse Java comparators
- Functionality to get and set the name of a Proto-Kittyscript function from Kittyscript code
- Fixed the yieldSafeCallWrap function that handles reapplying a function wrapper if the function is resumed after yielding
Things that need to be done next:
- Implement Kittyscript equals, hash and toString functions
- Implement error handling
- Write a lot more unit tests
Check out the Codeberg repo here:
https://codeberg.org/LunaDragofelis/kittyscript-kotlin
#Kittyscript #LangDev #PLDev -
Features I put into Kittyscript today:
- Adapter functions to compose and reverse Java comparators
- Functionality to get and set the name of a Proto-Kittyscript function from Kittyscript code
- Fixed the yieldSafeCallWrap function that handles reapplying a function wrapper if the function is resumed after yielding
Things that need to be done next:
- Implement Kittyscript equals, hash and toString functions
- Implement error handling
- Write a lot more unit tests
Check out the Codeberg repo here:
https://codeberg.org/LunaDragofelis/kittyscript-kotlin
#Kittyscript #LangDev #PLDev -
I published a short blog post on the quickscope integrated logic analyzer that I wrote a few weeks ago, and how I was able to do that in under 4 hours with Spade
-
I published a short blog post on the quickscope integrated logic analyzer that I wrote a few weeks ago, and how I was able to do that in under 4 hours with Spade
-
Now that Proto-Kittyscript is pretty much complete, it's time to actually design the APIs and objects for the proper Kittyscript.
I need to define the data structure for the abstract syntax tree (Cons tree with arbitrary annotations) and the compilation context. As well as the standard symbols and annotations.
#Kittyscript #LangDev -
Now that Proto-Kittyscript is pretty much complete, it's time to actually design the APIs and objects for the proper Kittyscript.
I need to define the data structure for the abstract syntax tree (Cons tree with arbitrary annotations) and the compilation context. As well as the standard symbols and annotations.
#Kittyscript #LangDev -
I did a short survey of #compiler backend targets: https://abhinavsarkar.net/notes/2025-compiler-backend-survey/
-
I did a short survey of #compiler backend targets: https://abhinavsarkar.net/notes/2025-compiler-backend-survey/
-
If someone were to write a new #compiler book today, what would you prefer the backend to emit? Learning about which backend would help the readers most these days?
#poll #compilers #PLdev #LangDev -
If someone were to write a new #compiler book today, what would you prefer the backend to emit? Learning about which backend would help the readers most these days?
#poll #compilers #PLdev #LangDev -
I finally uploaded the Kittyscript repo to Codeberg: https://codeberg.org/LunaDragofelis/kittyscript-kotlin
Now y'all can take a look at the code.
#Kittyscript #LangDev #PLDev -
I finally uploaded the Kittyscript repo to Codeberg: https://codeberg.org/LunaDragofelis/kittyscript-kotlin
Now y'all can take a look at the code.
#Kittyscript #LangDev #PLDev -
I’m officially working part time so that I can have more time for myself to work on #ArkScript (and also rest, go on small adventures…)
And this month I’ll finally publish the next (hopefully last) major of ArkScript, on which I’ve been working for about 3 years now!
https://arkscript-lang.devI’m looking for sponsors so that I can keep working on the project and deliver high quality code (https://github.com/sponsors/SuperFola)
-
I’m officially working part time so that I can have more time for myself to work on #ArkScript (and also rest, go on small adventures…)
And this month I’ll finally publish the next (hopefully last) major of ArkScript, on which I’ve been working for about 3 years now!
https://arkscript-lang.devI’m looking for sponsors so that I can keep working on the project and deliver high quality code (https://github.com/sponsors/SuperFola)
-
Would it not be nice to have a Ruby implementation that compiles down to C? #LangDev
-
CW: Long post about my plans for Kittyscript, the programming language I'm developing
Some things I want to implement next in #Kittyscript:
- Function composition
- List operations like map, filter, reduce, fold, reverse, flat-map and for-each, to be used with Lisp-style cons lists (cons pairs and the end-of-list marker are already implemented)
- Add more unit tests
- "Prompt" function to handle delimited continuations (as seen in Guile Scheme)
- "Dynamic Wind" function to handle non-local exits and re-entries (as seen in Guile Scheme)
- Records (also known as structs or objects in other languages)
- Method calls
- Parser combinator system
- General purpose equality comparison function
- Functions to access Java/Kotlin reflection functionality
The parser combinator system will allow mixing multiple languages' syntax elements. Imagine React's JSX (basically Javascript with a XML/HTML template syntax that allows arbitrary Javascript expressions inside the XML. There's also TSX, a Typescript version) but being able to replace Javascript with any Kittyscript compatible language. Without needing to reimplement the whole thing, as long as there's both the XML syntax and the syntax of your desired logic language available for Kittyscript.
The method calls will be dynamic, all method calls will semantically go through the same monomethod that can dynamically use the method key and variable amount of arguments to choose an implementation. Unless the compiler can tell statically which implementation will be used. (Think more of a dynamic language like Python or Javascript than a static one like Rust or C++)
Kittyscript will allow extensive compiler optimization assistance. For example an "optimize-if" macro, that's similar to an if/else expression, with a condition expression and two branch expressions. The first branch may be taken if the condition is true, the second branch may always be taken. The condition expression does not need to be evaluated at runtime, but is allowed to. The compiler is allowed to decide whether to always run the second branch, evaluate the condition at runtime to choose the branch, or determine that the condition will always be true and always run the first branch.
#LangDev #PLDev -
CW: Long post about my plans for Kittyscript, the programming language I'm developing
Some things I want to implement next in #Kittyscript:
- Function composition
- List operations like map, filter, reduce, fold, reverse, flat-map and for-each, to be used with Lisp-style cons lists (cons pairs and the end-of-list marker are already implemented)
- Add more unit tests
- "Prompt" function to handle delimited continuations (as seen in Guile Scheme)
- "Dynamic Wind" function to handle non-local exits and re-entries (as seen in Guile Scheme)
- Records (also known as structs or objects in other languages)
- Method calls
- Parser combinator system
- General purpose equality comparison function
- Functions to access Java/Kotlin reflection functionality
The parser combinator system will allow mixing multiple languages' syntax elements. Imagine React's JSX (basically Javascript with a XML/HTML template syntax that allows arbitrary Javascript expressions inside the XML. There's also TSX, a Typescript version) but being able to replace Javascript with any Kittyscript compatible language. Without needing to reimplement the whole thing, as long as there's both the XML syntax and the syntax of your desired logic language available for Kittyscript.
The method calls will be dynamic, all method calls will semantically go through the same monomethod that can dynamically use the method key and variable amount of arguments to choose an implementation. Unless the compiler can tell statically which implementation will be used. (Think more of a dynamic language like Python or Javascript than a static one like Rust or C++)
Kittyscript will allow extensive compiler optimization assistance. For example an "optimize-if" macro, that's similar to an if/else expression, with a condition expression and two branch expressions. The first branch may be taken if the condition is true, the second branch may always be taken. The condition expression does not need to be evaluated at runtime, but is allowed to. The compiler is allowed to decide whether to always run the second branch, evaluate the condition at runtime to choose the branch, or determine that the condition will always be true and always run the first branch.
#LangDev #PLDev -
“The Long Season Of Langdev”, Michael Fogus (https://blog.fogus.me/langdev/long-season.html).
Via Lobsters: https://lobste.rs/s/xecakg/long_season_langdev
-
“The Long Season Of Langdev”, Michael Fogus (https://blog.fogus.me/langdev/long-season.html).
Via Lobsters: https://lobste.rs/s/xecakg/long_season_langdev
-
recently been thinking a lot about how to integrate debugger functionality into #Kittyscript
also I wrote a few functions in proto-Kittyscript, a very basic language targeting the interpreter VM directly, ran them as part of Kotlin unit tests and already found and fixed a few bugs in the interpreter.
#LangDev #PLDev -
I’ve started writing an article on #ArkScript blog, to show how it differs from other Lisp (since ArkScript is just Lisp inspired, not aiming to be a complete lisp replacement/variant)
So far I’ve talked about scoping, namespacing, declaring variables and functions, touched quoting and data types.
What is an important point for you when looking at lisp like languages?
(Btw here is the blog https://arkscript-lang.dev/blog/)
-
Big thanks to @munificent — Crafting Interpreters inspired me to build my own programming language, Piscript (pixel Script)! 🚀
Just published it on GitHub: https://github.com/rolandbrake/piscript
#programming #interpreters #langdev #CraftingInterpreters -
#ArkScript April 2025 update is up!
-
We're in may and I haven't posted a new #ArkScript update article yet, but you can read this one instead:
https://lexp.lt/posts/inst_source_tracking_in_arkscript/
I talk about how I added source tracking on a per instruction basis inside ArkScript VM and it was quite well received on the not-very-orange-website (https://www.reddit.com/r/ProgrammingLanguages/comments/1kcef2l/instruction_source_location_tracking_in_arkscript/)