janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.45k stars 223 forks source link

Native Set Data Structure. #1228

Closed f2l2pe closed 1 year ago

f2l2pe commented 1 year ago

Hey, just wanted to know if it was considered to have a native set data structure in Janet.

If not maybe I can try to start building it, just need to brush up on my C knowledge because it's been a while.

tionis commented 1 year ago

I've built my own native set using https://janet.guide/xenofunctions/ as reference: https://github.com/tionis/toolbox/blob/main/src/set.c I want to upstream it to spork at some time, but currently it still has some edges that need to be fixed before it's ready for upstream I think. Also toolbox(the linked library) is very much a WIP at the moment, so it only compiles during the second compile step :sweat_smile:

f2l2pe commented 1 year ago

Oh cool, thanks for the reply. I'll just do like you're doing for now then and use the native one once its upstreamed :)

uvtc commented 1 year ago

Note, see: https://github.com/janet-lang/janet/issues/59

f2l2pe commented 1 year ago

Oh, thanks, I tried to find something about this in previous issues, but for some reason, it didn't appear on the search.

uvtc commented 1 year ago

Yeah, it's an older one -- 59!

sogaiu commented 1 year ago

@f2l2pe It looks like @tionis followed up on his remark and made a draft PR to spork for sets: https://github.com/janet-lang/spork/pull/144

May be the current issue here can be closed then?

P.S. Nice penguin image :)