Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 01:46
    Techcable opened #997
  • Jul 05 11:11
    autumnull opened #163
  • Jul 05 08:40
    saikyun commented #921
  • Jul 04 21:48
    bakpakin closed #996
  • Jul 04 21:48

    bakpakin on master

    Fix #996 - linking command work… (compare)

  • Jul 04 21:26
    bakpakin labeled #996
  • Jul 04 21:24
    bakpakin commented #996
  • Jul 04 21:24
    bakpakin commented #996
  • Jul 04 18:23
    LeviSchuck opened #996
  • Jul 04 16:27
    tionis opened #995
  • Jul 03 17:29

    bakpakin on master

    Allow shorthand for setting tas… (compare)

  • Jul 03 06:00
    pepe commented #991
  • Jul 03 05:34
    pepe commented #993
  • Jul 03 02:11

    bakpakin on master

    Fix function handlers for :out … Merge branch 'master' of github… (compare)

  • Jul 02 17:30

    bakpakin on master

    Use relative path for include/j… Merge pull request #994 from sh… (compare)

  • Jul 02 17:30
    bakpakin closed #994
  • Jul 02 17:29
    bakpakin commented #994
  • Jul 02 15:52
    shassard synchronize #994
  • Jul 02 15:45
    shassard opened #994
  • Jul 02 15:38
    bakpakin closed #788
saikyun
@saikyun
I took a break from working on my blog, hopefully I'll get to it again sometime soon :)
2 replies
I got a new job and will work 50% on creating a game using Freja :D starting in janetuary
yumaikas-
@yumaikas:matrix.org
[m]
Congratulations 🎉
1 reply
pp
@damnpepe:matrix.org
[m]
bakpakin: just an idea, but I guess we can have (get (int/64 1) 0) for the first byte and so on?
bakpakin
@bakpakin:matrix.org
[m]
@pp that sounds like a very bad interface
pp
@damnpepe:matrix.org
[m]
true :)
harryvederci
@harryvederci
Nice saikyun, will you blog about making the game?
saikyun
@saikyun
@harryvederci I was mostly thinking about blogging about Freja, but atm I've only written half a blog post, so who is to tell :P
llmII
@llmii:matrix.org
[m]
If one was to need a config file for software they've written, what do people typically use with Janet
I see there is support for toml and json. No idea about yaml or ini. I really dislike json for configuration files, but I have used json with Janet for talking to other processes so I know that works well. XML and alike are most definitely a no go.
pp
@damnpepe:matrix.org
[m]
I am using .jdn where needed
llmII
@llmii:matrix.org
[m]
pp: approachable from a human standpoint? (like, can comment in the file)
pp
@damnpepe:matrix.org
[m]
very good question about which I am not sure, but it is a Janet code at the end, so I guess you can
llmII
@llmii:matrix.org
[m]
hmmm, since it's janet code, I guess the major diff between it and regular janet code is it only allows returning values? as in, protected from arbitrary code exec?
pp
@damnpepe:matrix.org
[m]
well I am reading the config this way: (def file-conf ((compile (parse (slurp file))))) so definitely executing the code
but I guess you can protect it easily
sogaiu
@sogaiu:matrix.org
[m]
depending on what you want, you don't need to do compile iiuc: https://github.com/janet-lang/janet/blob/master/test/suite0008.janet#L297-L298
pp
@damnpepe:matrix.org
[m]
Indeed. to be frank, I am not sure why I do in the snippet I have sent :-)
llmII
@llmii:matrix.org
[m]
seems I should learn what the parse function does...
pp
@damnpepe:matrix.org
[m]
well I highly recommend it, especially to someone already deep in Janet as I feel you are
llmII
@llmii:matrix.org
[m]
@pp: you mean parse or jdn?
pp
@damnpepe:matrix.org
[m]
parse sry
llmII
@llmii:matrix.org
[m]
sogaiu: that's awesome, the example you linked
sogaiu
@sogaiu:matrix.org
[m]
parse wraps the parser/* stuff
pp
@damnpepe:matrix.org
[m]
thank you sogaiu!
llmII
@llmii:matrix.org
[m]
pp: just had to be sure, parse really definitely will be useful to know
sogaiu
@sogaiu:matrix.org
[m]

llmII: here's a taste of what you can do with parser/* stuff: https://github.com/sogaiu/janet-editor-elf/blob/master/janet-editor-elf/delims.janet#L16-L53

this is what i use to find missing delimiters in "partial" code

llmII
@llmii:matrix.org
[m]
I'll probably want the parser api, if I could somehow parse multiple blocks, or I guess I could just wrap the entire file in [] to get it all back as an array of toplevel values
sogaiu
@sogaiu:matrix.org
[m]
yes i think that would work (assuming you added a @ on the front)
parsing multiple things should be doable too
llmII
@llmii:matrix.org
[m]
I'm guessing the full parser API would be needed for the multiple things?
sogaiu
@sogaiu:matrix.org
[m]
yes i think so
unless you wrap like you described
llmII
@llmii:matrix.org
[m]
that's why my first thought was array-wrapping a string, keeps things simple to be just a single parse call
sogaiu
@sogaiu:matrix.org
[m]
well...
yes :)
llmII
@llmii:matrix.org
[m]
hehehe, I thought you were about to mention an edge case where doing so means breaking everything lol
sogaiu
@sogaiu:matrix.org
[m]
:)
llmII
@llmii:matrix.org
[m]
thanks sogaiu, @pepe
pp
@damnpepe:matrix.org
[m]
you are welcome
llmII
@llmii:matrix.org
[m]
um pp *
pp
@damnpepe:matrix.org
[m]
same one, the former is french tho
llmII
@llmii:matrix.org
[m]
hehe, I see, still getting used to matrix, and tab complete selection, good to know they're both you
pp
@damnpepe:matrix.org
[m]
indeed
anyway, this part of Janet is the one I like a lot. Not that I am using it that often, but there is something calming in the knowledge that it exists :-). And is not that hard to use, when needed
llmII
@llmii:matrix.org
[m]
wonder what's a good way to collect and display a parsing error for end user purposes from the parse function, but yep pp having the parser available like that, emitting values but not evaluating, is awesome 😀
2 replies
llmII
@llmii:matrix.org
[m]
pp: got to thinking about it, the context stuff, saw an example of that somewhere actually, very useful, as to do-file... could spawn it in another fiber with a deadline and between limiting context so they basically only get def/var and specials and maybe something you want to insert, and setting a deadline (no infinite while loops), can possibly prevent that
by prevent that, I mean, prevent arbitrary code exec
I'm unsure if the deadline for a spawned coroutine will work if all that is done is blocking actions
llmII
@llmii:matrix.org
[m]
ev/with-deadline won't work for that, as I feared, might be better to just start a process to read the config, or start a thread really