home.social

#arkscript — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #arkscript, aggregated by home.social.

fetched live
  1. 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

  2. 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

  3. 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

    #PLdev #langdev

  4. 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

    #PLdev #langdev

  5. I had the same algorithm in cpp and #ArkScript, my language but it didn’t behave the same somehow…

    Well, #cpp ceils negative numbers in an integer division, while I was doing a floor div in ArkScript…

    Off by one errors are always fun to track

  6. I had the same algorithm in cpp and #ArkScript, my language but it didn’t behave the same somehow…

    Well, #cpp ceils negative numbers in an integer division, while I was doing a floor div in ArkScript…

    Off by one errors are always fun to track

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

  8. 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

  9. I'm conflicted about how I should implement UTF8 support for strings in my language, #ArkScript

    There seem to be two options:
    1. Every string is UTF8, thus every access to a char is O(n) and not O(1) anymore (have to decode the codepoints to count them). Length is O(n) too. That pretty much pessimizes all strings, even ASCII ones, but makes working with UTF8 codepoints easier
    2. Every string is just a series of bytes, as it is right now, and a (@ string index) returns a potentially invalid character (on 8 bits). Indexing and length are O(1), but we need a function to get the codepoints, like (string:codepoints str) or (string:graphemes str) or something else
    3. third hidden option that I want to avoid and that doesn't really count: introduce another string type that's different from normal strings. That's bad because the C++ API will be impacted, and the internals will need to handle all the different string types

    At first, I thought option 1 was better because then everything is easy, since the language is high-level. But now I lean toward option 2 because UTF8 support won't hinder the performance of programs that don't need it, and doing such a thing should be intentional

    #pldev

  10. I'm conflicted about how I should implement UTF8 support for strings in my language, #ArkScript

    There seem to be two options:
    1. Every string is UTF8, thus every access to a char is O(n) and not O(1) anymore (have to decode the codepoints to count them). Length is O(n) too. That pretty much pessimizes all strings, even ASCII ones, but makes working with UTF8 codepoints easier
    2. Every string is just a series of bytes, as it is right now, and a (@ string index) returns a potentially invalid character (on 8 bits). Indexing and length are O(1), but we need a function to get the codepoints, like (string:codepoints str) or (string:graphemes str) or something else
    3. third hidden option that I want to avoid and that doesn't really count: introduce another string type that's different from normal strings. That's bad because the C++ API will be impacted, and the internals will need to handle all the different string types

    At first, I thought option 1 was better because then everything is easy, since the language is high-level. But now I lean toward option 2 because UTF8 support won't hinder the performance of programs that don't need it, and doing such a thing should be intentional

    #pldev

  11. I don’t know what happened, but #ArkScript got faster than python and slower than Lua, at the same time.

    The benchmarks all run on the same machine and the languages versions are fixed.

    What the hell

  12. I don’t know what happened, but #ArkScript got faster than python and slower than Lua, at the same time.

    The benchmarks all run on the same machine and the languages versions are fixed.

    What the hell

  13. Hey everyone, I'm trying to implement a "slice" function but I'm not sure how to go with negative steps

    Let's say we have (slice start end [step])
    And
    (slice alphabet 0 10) returns abcdefghij

    What should this
    (slice alphabet 0 10 -1) return?
    FWIW, #Python returns nothing for alphabet[0:14:-1]

    #pldev #ArkScript

  14. Hey everyone, I'm trying to implement a "slice" function but I'm not sure how to go with negative steps

    Let's say we have (slice start end [step])
    And
    (slice alphabet 0 10) returns abcdefghij

    What should this
    (slice alphabet 0 10 -1) return?
    FWIW, #Python returns nothing for alphabet[0:14:-1]

    #pldev #ArkScript

  15. According to my testing, embedding #ArkScript works well with low resources, as it only needs 1MB of disk space and 4.6MB of RAM!

    It isn't the tinyest but it isn't the biggest either!

    #TinyScheme sits at the top, with only 84KiB of disk and 3MB of RAM needed, and #Lua is close with 271KiB of disk and 1.9MB of RAM

    github.com/ArkScript-lang/embe

  16. According to my testing, embedding #ArkScript works well with low resources, as it only needs 1MB of disk space and 4.6MB of RAM!

    It isn't the tinyest but it isn't the biggest either!

    #TinyScheme sits at the top, with only 84KiB of disk and 3MB of RAM needed, and #Lua is close with 271KiB of disk and 1.9MB of RAM

    github.com/ArkScript-lang/embe

  17. CW: ArkScript quine and code golf

    I’ve been doing some code golf on code.golf, using my own language, #ArkScript

    And I found a fun Quine (program that outputs itself), without using io:readFile:

    ```
    (let _"(let _{:?})(puts(format _ _))")(puts(format _ _))
    ```

    `format` is using fmtlib under the hood, and it’s pretty handy!

  18. CW: ArkScript quine and code golf

    I’ve been doing some code golf on code.golf, using my own language, #ArkScript

    And I found a fun Quine (program that outputs itself), without using io:readFile:

    ```
    (let _"(let _{:?})(puts(format _ _))")(puts(format _ _))
    ```

    `format` is using fmtlib under the hood, and it’s pretty handy!

  19. People, we have a debugger in #arkscript

    arkscript-lang.dev/docs/tutori

    and it's more tested than the repl somehow (I had to develop a new kind of tests for this one, so that I can skip the prompt and feed it lines from a file)

  20. People, we have a debugger in #arkscript

    arkscript-lang.dev/docs/tutori

    and it's more tested than the repl somehow (I had to develop a new kind of tests for this one, so that I can skip the prompt and feed it lines from a file)

  21. I’ve learned #arkscript, a language I’ve been working on for a few years now, is being used as a code gold language by people on the internet

    And they found bugs (hopefully it’s fixed now, 24 hours after I’ve been informed and started working on the fix)

    It is truly awesome, and now I can’t wait to go back to work on more features (the current one being adding a debugger)

  22. I’ve learned #arkscript, a language I’ve been working on for a few years now, is being used as a code gold language by people on the internet

    And they found bugs (hopefully it’s fixed now, 24 hours after I’ve been informed and started working on the fix)

    It is truly awesome, and now I can’t wait to go back to work on more features (the current one being adding a debugger)

  23. I used #ArkScript for the #AdventOfCode and it helped me improve the language as well as find bugs
    You can read about the whole adventure on my blog: lexp.lt/posts/arkscript_advent
    Some bugs were very dirty and I’m glad I caught them…

    #pldev #compiler

  24. I used #ArkScript for the #AdventOfCode and it helped me improve the language as well as find bugs
    You can read about the whole adventure on my blog: lexp.lt/posts/arkscript_advent
    Some bugs were very dirty and I’m glad I caught them…

    #pldev #compiler

  25. Since the Advent of Code, I've added about 50 new algorithms to #ArkScript standard library it seems
    And it won't stop growing, even if I'll probably be the sole user of the language, it's quite fun to put your own stdlib together

    arkscript-lang.dev/ (with a live counter of algorithms in the stdlib on the frontpage because I could)

  26. Since the Advent of Code, I've added about 50 new algorithms to #ArkScript standard library it seems
    And it won't stop growing, even if I'll probably be the sole user of the language, it's quite fun to put your own stdlib together

    arkscript-lang.dev/ (with a live counter of algorithms in the stdlib on the frontpage because I could)

  27. Also, it means nothing, but I've done over 3000 commits in #ArkScript, and about 6.67 years of working on the project
    It brings me joy, because it shows me that I can do things and keep doing them

  28. Also, it means nothing, but I've done over 3000 commits in #ArkScript, and about 6.67 years of working on the project
    It brings me joy, because it shows me that I can do things and keep doing them

  29. I've added some kind of fused multiply add to #ArkScript.

    "some kind of", because I can fuse 2 to 3 successive math operations in a single bytecode instruction, and this helps by removing useless push/pop the VM stack!

    Before: 7 push, 6 pop
    After (with 3 fused math ops): 5 push, 4 pop

    And it was pretty easy to code, as I have a somewhat decent IR optimization engine, I just had to generate a bunch of rules to fuse instructions together!

  30. I've added some kind of fused multiply add to #ArkScript.

    "some kind of", because I can fuse 2 to 3 successive math operations in a single bytecode instruction, and this helps by removing useless push/pop the VM stack!

    Before: 7 push, 6 pop
    After (with 3 fused math ops): 5 push, 4 pop

    And it was pretty easy to code, as I have a somewhat decent IR optimization engine, I just had to generate a bunch of rules to fuse instructions together!

  31. So happy to have completed at least part 1 of every #AdventOfCode challenge!
    I only had to give up on day 10 part 2, and there is no part 2 for day 12, otherwise I was able to do every single challenge using #ArkScript, my own scripting language, and it was an amazing opportunity to improve the standard library too!

  32. So happy to have completed at least part 1 of every #AdventOfCode challenge!
    I only had to give up on day 10 part 2, and there is no part 2 for day 12, otherwise I was able to do every single challenge using #ArkScript, my own scripting language, and it was an amazing opportunity to improve the standard library too!

  33. I reworked #ArkScript type errors so that they show more information, and are easier to read!

  34. I reworked #ArkScript type errors so that they show more information, and are easier to read!

  35. I’ve released #ArkScript 4.1.0 with argument attributes, and noticed just now that I’ve broken the code formatter… it is tested, but what i have broken what specifically tested, because said formatter is very complex

    I’ll have to make a 4.1.1 to fix that, but hey new ArkScript release with an even bigger and better standard library thanks to the #AdventOfCode !

    github.com/ArkScript-lang/Ark/

    #pldev

  36. I’ve released #ArkScript 4.1.0 with argument attributes, and noticed just now that I’ve broken the code formatter… it is tested, but what i have broken what specifically tested, because said formatter is very complex

    I’ll have to make a 4.1.1 to fix that, but hey new ArkScript release with an even bigger and better standard library thanks to the #AdventOfCode !

    github.com/ArkScript-lang/Ark/

    #pldev

  37. Arguments as references (const ref if we are speaking in #cplusplus terms) have been added to #ArkScript !
    When used with big datasets (eg lists) they can yield up to a 5% perf improvement, and having the attribute in the signature makes it explicit that we are using a reference

    I really wanted to lean hard on « no hidden behavior » and this will help tremendously, as well as the « mut » attribute, allowing users to mutate the function arguments (which are copies of what you pass to the function anyway)

    #pldev

  38. Arguments as references (const ref if we are speaking in #cplusplus terms) have been added to #ArkScript !
    When used with big datasets (eg lists) they can yield up to a 5% perf improvement, and having the attribute in the signature makes it explicit that we are using a reference

    I really wanted to lean hard on « no hidden behavior » and this will help tremendously, as well as the « mut » attribute, allowing users to mutate the function arguments (which are copies of what you pass to the function anyway)

    #pldev

  39. Mutable arguments have been implemented!
    By default all arguments are constant and you can’t update them in your functions

    It took way less time than I thought, and it is already well tested too ; the bigger problem is now how will I implement the read only ref arguments without destroying performances…

    #ArkScript #pldev

  40. Mutable arguments have been implemented!
    By default all arguments are constant and you can’t update them in your functions

    It took way less time than I thought, and it is already well tested too ; the bigger problem is now how will I implement the read only ref arguments without destroying performances…

    #ArkScript #pldev

  41. I’ve bitten the bullet and started working on argument attributes in #ArkScript :

    (fun (a b (mut c) (ref d)) body…)

  42. I’ve bitten the bullet and started working on argument attributes in #ArkScript :

    (fun (a b (mut c) (ref d)) body…)

  43. @ericwastl I’m planning on using my own language, #ArkScript ! Used it for the first challenges of last year, it helped a ton in shaping the standard library of the language
    My IDE of choice will be neovim :blobfoxsmirk: (it’s neo so it’s better right?)
    Haven’t checked Lua yet, always need more sleep!

  44. @ericwastl I’m planning on using my own language, #ArkScript ! Used it for the first challenges of last year, it helped a ton in shaping the standard library of the language
    My IDE of choice will be neovim :blobfoxsmirk: (it’s neo so it’s better right?)
    Haven’t checked Lua yet, always need more sleep!

  45. ArkScript v4 is finally out!

    After nearly 3 years of work, a big compiler rework, an enhanced macro system, a bunch of VM optimisations, and a new import system, it is ready to be used

    github.com/ArkScript-lang/Ark/

    Check out the documentation if you need help getting started with the language: arkscript-lang.dev/docs/prolog

    #ArkScript #pldev #opensource #BuildInPublic

  46. ArkScript v4 is finally out!

    After nearly 3 years of work, a big compiler rework, an enhanced macro system, a bunch of VM optimisations, and a new import system, it is ready to be used

    github.com/ArkScript-lang/Ark/

    Check out the documentation if you need help getting started with the language: arkscript-lang.dev/docs/prolog

    #ArkScript #pldev #opensource #BuildInPublic

  47. 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!
    arkscript-lang.dev

    I’m looking for sponsors so that I can keep working on the project and deliver high quality code (github.com/sponsors/SuperFola)

    #pldev #langdev #cpp #BuildInPublic #opensource

  48. 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!
    arkscript-lang.dev

    I’m looking for sponsors so that I can keep working on the project and deliver high quality code (github.com/sponsors/SuperFola)

    #pldev #langdev #cpp #BuildInPublic #opensource

  49. I’ve reached a coverage of 89.731% of #ArkScript code

    My goal being nearly 100% on the parser, the different compiler passés and most importantly the virtual machine

    Which I should have pretty soon, the parser is at 100% and compiler passes are already maxed out (some lines can not be tested, because I’m printing things to the screen or having switch case defaults on unknown enum types and everything is handled for now), the last thing to do being the VM!

  50. I’ve reached a coverage of 89.731% of #ArkScript code

    My goal being nearly 100% on the parser, the different compiler passés and most importantly the virtual machine

    Which I should have pretty soon, the parser is at 100% and compiler passes are already maxed out (some lines can not be tested, because I’m printing things to the screen or having switch case defaults on unknown enum types and everything is handled for now), the last thing to do being the VM!

  51. I've created a first rough draft of an article comparing #ArkScript and other #Lisp like #Clojure and #CommonLisp !

    Please tell me what you think about it! If you'd like something to be more detailed, or a specific facet of those langs to be used as a comparison point, etc

    arkscript-lang.dev/blog/compar

    #blog #pldev #scheme

  52. I've created a first rough draft of an article comparing #ArkScript and other #Lisp like #Clojure and #CommonLisp !

    Please tell me what you think about it! If you'd like something to be more detailed, or a specific facet of those langs to be used as a comparison point, etc

    arkscript-lang.dev/blog/compar

    #blog #pldev #scheme

  53. I’m 21 commits down a refactor of how #ArkScript display errors in source code, all of this centered around storing the position of a token

    I have 3 ways to find the length of a faulty expression and I don’t understand why (it was a hack at first and then it stayed).

    It could all be solved if I have both the start and end position of every token/node

    This is not fun and I need a break 😮‍💨

  54. I’m 21 commits down a refactor of how #ArkScript display errors in source code, all of this centered around storing the position of a token

    I have 3 ways to find the length of a faulty expression and I don’t understand why (it was a hack at first and then it stayed).

    It could all be solved if I have both the start and end position of every token/node

    This is not fun and I need a break 😮‍💨

  55. #ArkScript now has CLI argument parsing done right!
    I can't wait to finalize this next major release

  56. #ArkScript now has CLI argument parsing done right!
    I can't wait to finalize this next major release