Git Product home page Git Product logo

Comments (5)

bakpakin avatar bakpakin commented on July 21, 2024 1

Yeah, a lot of confusion here.

First, you would need to run the net repl server on a client in a new fiber, for example with (ev/spawn …). And yes, since jaylib is blocking there is some latency but in practice this should actually work alright - at 60fps, requests will have 16ms latency. Still, not ideal but not a deal breaker.

second, telnet is not anything you want here, the netrepl protocol requires a real client. β€˜janet-netrepl -c’ is the command you would use to connect.

from spork.

bakpakin avatar bakpakin commented on July 21, 2024

What OS and janet version are you using? If the static library is built I don't see why the .so would not be built.

Also worth making sure you have an up to date jpm with sudo jpm install jpm

from spork.

bakpakin avatar bakpakin commented on July 21, 2024

Also the output of jpm show-paths should have modpath as /usr/local/lib/janet, according to your stacktrace. If it doesn't, it may be that rawterm.so was installed somewhere else and jpm/janet is configured incorrectly

from spork.

paines avatar paines commented on July 21, 2024

After updating jpm and installing sprok again this issue is gone. Thanks for your support.

from spork.

paines avatar paines commented on July 21, 2024

Sorry for reopening!

Maybe I have misunderstood what netrepl is supposed to do or supposed to be used for. I want to develop a game interactivly and have some code:

(use jaylib)

(import spork/netrepl)

(defn draw []
  (let [[x y] (get-mouse-position)]
    (draw-circle-gradient (math/floor x) (math/floor y) 31.4 :lime :red)
    (draw-poly [500 200] 5 40 0 :magenta)
    (draw-line-bezier
      [(- x 100) y]
      [(+ x 100) (+ y 50)]
      4 :pink)
    (draw-line-ex
      [x (- y 10)]
      [x (+ y 10)]
      4 :sky-blue)
    (draw-line-strip
      [[x 0] [x 100] [50 y] [10 180]]
      :ray-white)))

(netrepl/server-single)

(init-window 1024 768 "Test Game")
(set-target-fps 60)
(hide-cursor)

(while (not (window-should-close))
  (begin-drawing)
  (clear-background [0 0 0])
  (draw)
  (end-drawing))

(close-window)

So jaylib is setup, there is a window and a proper drawing loop . I also started a netrepl which should wait on incoming connections. Now I would telnet localhost port 9365 and update the draw function (again and again), and see my changes. So the plan. Maybe it would need some locking before updating the drawing, but in theory the plan should work. But netrepl seems not to evaluate anything. Also I tried the netrepl/client but the effect is the same.

from spork.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.