dictu-lang / Dictu

Dictu is a high-level dynamically typed, multi-paradigm, interpreted programming language.
https://dictu-lang.com
MIT License
268 stars 53 forks source link

Feat: Buffer api #731

Closed liz3 closed 7 months ago

liz3 commented 7 months ago

Buffer API

What's Changed:

Implements a Buffer API inspired by Node.js's buffer api, including writing strings and all integer types. Sadly even though i tried to reduce it as far as i could theres a loooot of duplication because of the fact there are 4 integer types, im open to suggestions which can help reduce the duplication.

Note: I commited .clang-format because thats the formatter i use and it's default setting is set to 2 spaces and so i thought it might be useful, can remove if not needed

Type of Change:

#

Housekeeping:

Screenshots (If Applicable):

image
briandowns commented 7 months ago

This is super cool. Reminds me that we still need to get that native bytes type implemented.

As for the PR, I'll refrain from commenting until you're ready but I'll mention there's a few places that still have the original code / names from the copy/paste. I do the exact same thing. :)

Side note, and happy to take to a different forum like the discussion section but would love to understand your uses of Dictu!

liz3 commented 7 months ago

I wonder mostly if theres a way to reduce the copy paste for the integer methods which currently take up the majority of the file and only contain very small differences, thinking to have a generalised read/write to reduce it and then just have the typecast to the correct integer type.

Regarding forum you can mail me: liz3@liz3.net or discord: liz3

Jason2605 commented 7 months ago

Damn yeah this looks really neat! What I'll do with it being WIP is mark it as draft, then just mark it as ready whenever you're good to go!

Jason2605 commented 7 months ago

Sorry for being slow on this! @briandowns be good to get your thoughts on this one too if you get a spare moment!

liz3 commented 7 months ago

Couple of pretty minor points, thanks so much for the effort on this!

Should be addressed.

liz3 commented 7 months ago

Why do the tests for *nix likes take 2 hrs? Is this coming from my changes or githubs runners?

briandowns commented 7 months ago

My guess is that it's the runners. On Linux, MacOS, and FreeBSD, (locally) the suite runs very quickly.

Jason2605 commented 7 months ago

Thanks so much for this!