@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
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

#pldev #langdev

make a major release
100%
deprecate and change the return type
0%
other option (please comment)
0%
Poll ended at .

Создание своего языка программирования на Rust #3: Парсинг стейтментов вывода и присвоения

Третья часть написания своего языка программирования на Rust с нуля: Парсинг первых стейтментов языка: вывод и присвоение.

https://habr.com/ru/articles/1044772/

#rust #langdev

Создание своего языка программирования на Rust #3: Парсинг стейтментов вывода и присвоения

Привет читающим! Эта статья будет значительно короче двух предыдущих, и будущие статьи будут такие же короткие, потому что так легче писать и искать ошибки. Также, думаю, читать так будет удобнее. Как...

Хабр

Создание своего языка программировани на Rust #2: Парсер выражений

Вторая часть по понисанию своего языка программирования с нуля на Rust: Написание парсера для выражений.

https://habr.com/ru/articles/1044502/

#rust #langdev

Создание своего языка программирования на Rust #2: Парсер выражений

Привет, Хабр! Что будем делать? Мы напишем парсер для примерно таких выражений: 1+2*(2+8)*2*a+3 . Сначало мы добавим парсер для арифметических выражений, а после сразу же займемся сравнениями и...

Хабр

Создание своего языка программировани на Rust #1: Лексер

Гайд о том, написание интерпритируемого языка с динамической слабой типизацией на языке Rust с нуля. Часть 1: Написание лексического анализатора.

https://habr.com/ru/articles/1044358/

#rust #langdev #язык_с_нуля

Создание своего языка программировани на Rust #1: Лексер

Привет, Хабр! В статье я хочу рассказать как создать свой язык программирования с нуля на Rust. Ориентируюсь я на тех, кто еще не писал свои языки и знает Rust, нужно уже хорошо в нем разбираться....

Хабр
Days 42 and 43 of making my own indie MMO without engine or team

Yesterday I reached performance parity with souffle's datalog compiler on my tests, I was holding out this post in hopes that I would be able to beat it, and I managed to do so. My implementation may be faster overall since I only handle EAV form, but I won't claim it is when I haven't tested all different possible workloads (which can be a lot) in which souffle's compiler will beat it but these benchs were representative of the loads I expect.

So far I can only think of a couple more improvements I could do to get better performance:
  • Introduce some sort of sort of pgo. Right now I decide the order in which coditions are solved based on the size of the first query, but it may be better to profile it since that way I could avoid building some additional indices and save bandwidth there.
  • Shrink the size of the different entities and values encoding down from 25 bits to 18 (this would be a really nice speed boost but I don't know if I can do this yet).
  • I have this idea to make resizing of hashtables faster at the cost of making probing slightly slower, but since it would change significantly the hashes It'd be hard to empirically measure if there have been any measurable, reliable gains or not.
Either way I'm mentioning this as a way to log them in case I want to check them out in the future. Since this is the fourth or fifth day working on this, and it's currently a little over 9100 times faster than my original implementation. Beating souffle's compiled one with my interpreter (on my single-threaded benchmarks) is good enough for me, so I'll call it a day and go back to integrating this with my half-baked parser, then with my ir/jit, then into the engine to have aot scripting.

I also started reading the #gamewriting #kaleidoscope, It's a very interesting book, and I'm sure somewhere inside I can get an actual tip to execute on what I have in mind. I already talked in the past about how I want quests to work, I also mentioned I have a vague idea of how I will workaround my limitations to implement proper chat and instead go with canned phrases. But I have no idea how to execute the writing I'm thinking of, the closest reference I know of would be something like Magicka, or Bastion. I've been sharing my thoughts of the different chapters I've read elsewhere, because I'd like to focus here on my daily progress, but I'll eventually mention if I find what I'm looking for and whether I can recommend the book to non-writers or not.


#woao #programming #coding #gamedev #indiedev #langdev

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 :)

#LangDev