Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 06 02:08
    bakpakin closed #1005
  • Aug 04 14:25
    pepe commented #1006
  • Aug 04 13:13
    bakpakin closed #1006
  • Aug 04 13:13
    bakpakin commented #1006
  • Aug 04 13:00
    pepe opened #1006
  • Aug 03 01:16
    ahungry commented #324
  • Aug 03 01:11
    ahungry commented #324
  • Aug 02 19:58

    bakpakin on master

    Fix docstring. (compare)

  • Aug 02 17:34

    bakpakin on master

    Add testcase for issue #1005 (compare)

  • Aug 02 17:23
    bakpakin commented #1005
  • Aug 02 17:19

    bakpakin on master

    Get rid of disabled tracing. #1… (compare)

  • Aug 02 17:17
    bakpakin commented #1005
  • Aug 02 17:14

    bakpakin on master

    Address #1005 - Fix janet_call … (compare)

  • Aug 02 17:04
    paulsnar commented #1005
  • Aug 02 16:56
    bakpakin commented #1005
  • Aug 02 16:50
    bakpakin commented #1005
  • Aug 02 15:19
    bakpakin labeled #1005
  • Aug 02 14:58
    paulsnar commented #1005
  • Aug 02 13:00
    paulsnar commented #1005
  • Aug 02 13:00
    paulsnar commented #1005
Levi R. I. Tan Ong
@levitanong
Hi all! I'm trying to develop a simple slack bot on janet (basically an http server) and I'm using circlet and ijanet on emacs. Right now I have an insane workflow where every time I change something, I have to interrupt the entire janet process (C-c C-c on emacs) and restart the repl, reevaluate the buffer, then start the server. The experience with vscode is pretty much the same. Is there a better way?
saikyun
@saikyun
Do you have eval buffer in ijanet? :)
If you want to keep state around, you can implement defonce: https://github.com/janet-lang/janet/discussions/607
I don't know anything about circlet though
Levi R. I. Tan Ong
@levitanong
ah sorry, i phrased it weirdly. I'm running ijanet on emacs (and yes i have the eval buffer) and i'm trying to use circlet, which is a webserver based on mongoose. It has a (while true) to keep the server running, and it seems like the repl is blocked while this is happening. Having said this, I realize the solution might simply be to wrap it in a coroutine. That would make it async, and perhaps not block the repl.
andrewchambers
@andrewchambers
I think you need to consider which bits of state are persistent and which are not
and use vars
and manually code some reloading logic
but i think its possible
saikyun
@saikyun
I solved a similar problem with netrepl and ev/call. Relevant bits of code: https://github.com/Saikyun/text-experiment/blob/main/src/main.janet#L503
I also used dofile to get an env and merge it into the root env: https://github.com/Saikyun/text-experiment/blob/main/src/file_handling.janet#L54
@sogaiu:matrix.org has some info about using netrepl from Emacs, but I'm not sure if that code is public
Zach Smith (subsetpark)
@subsetpark:matrix.org
[m]
There’s an ijanet now??
sogaiu
@sogaiu:matrix.org
[m]
i think the emacs netrepl code i have is here: https://gist.github.com/sogaiu/aa957885d965e4b874fc83c55f873719
@subsetpark: may be you found it already, but iiuc, ijanet refers to this: https://github.com/SerialDev/ijanet-mode
andrewchambers
@andrewchambers
@bakpakin:matrix.org i sometimes wonder if polymorphic number functions should have just called methods instead of using polymorphic operators. It seems more orthogonal
e.g.
(:+ a b)
it seems pretty clear what is going on
so the answer to writing a polymorphic formula would have been to use methods for everything
i guess that would have required methods on things like Number
the syntax doesn't even look that bad imo
i guess it would put you in the situation that to use int/s64 you would be required to use methods
andrewchambers
@andrewchambers
in hind sight i think basically everything numeric function that is polymorphic should be under a namespace like
poly/pos? poly/max poly/min ...
and they would be implemented in terms of methods
I think its currently quite error prone in the stdlib to use any of the standard functions with abstract number types
since a bad comparison often silently returns true or false
due to total ordering
andrewchambers
@andrewchambers
but yeah, i feel like method calls should be the way to do polymorphism
im not sure the real value having + call a method on fallback provides
andrewchambers
@andrewchambers
perhaps the fact that numbers do not have methods pulled janet towards having special semantics in operators
though i think it might not be that bad to do static method lookup for primitive types
in the method call opcode
anyway, not sure this is a good idea or not, just some thoughts
andrewchambers
@andrewchambers
bah, wrong chat, sorry
Levi R. I. Tan Ong
@levitanong
Thanks @Saikyun and @andrewchambers ! I will digest this over the coming days.
yumaikas-
@yumaikas:matrix.org
[m]
So, is anyone keeping a Janet dockerfile around? I'm planning on using docker to help packat a project, and I am willing to write one, but wanted to check for prior art
Never used it for anything, but tested that it works. I settled for the classic PHP "files on the server" approach
andrewchambers
@andrewchambers
@yumaikas:matrix.org how does docker help? do you depend on some system library?
yumaikas-
@yumaikas:matrix.org
[m]
It helps by giving me a cross platform "Run this to check out this janet project"
Instead of trying to cross compile, or have the people in question go through the Janet installation process
andrewchambers
@andrewchambers
@yumaikas:matrix.org but then don't people need to deal with the Docker installation process?
for me that was a lot worse
yumaikas-
@yumaikas:matrix.org
[m]
@andrewchambers: this is a program for a specific set of people I expect to be more familiar with Docker than Janet, not a general distribution of code. Otherwise I'd share your concerns
ahungry
@ahungry:matrix.org
[m]
Janet in docker is a nice sandbox, perhaps easier to setup than a chroot for web janet and so small via alpine
Janet cross platform is fun but tricky
andrewchambers
@andrewchambers
i uninstalled docker after i started doing backups and seeing all the shit it does pointlessly every second to my filesystem, even when idle. Not a fan haha.