Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 22 01:25
    sonygod edited #95
  • Nov 22 01:23
    sonygod opened #95
  • Nov 15 02:37

    kevinresol on master

    Automatically bring in static e… (compare)

  • Nov 12 20:34
    Gennoken closed #39
  • Nov 12 20:33
    Gennoken edited #39
  • Nov 12 20:30
    Gennoken opened #39
  • Oct 03 10:11
    gene-pavlovsky commented #165
  • Sep 26 21:31

    andyli on master

    allow date == date (compare)

  • Sep 12 11:52
    benmerckx commented #111
  • Sep 11 16:05
    onehundredfeet commented #111
  • Aug 24 14:18

    benmerckx on master

    Default to the "utf8mb4" charse… (compare)

  • Aug 19 09:47

    back2dos on haxe-10739

    Work around for https://github.… (compare)

  • Aug 17 10:39

    back2dos on master

    Slices are iterables. (compare)

  • Jul 25 13:57
    back2dos closed #131
  • Jul 25 13:57

    back2dos on master

    Safely navigate nullable objects More tests Merge pull request #131 from ha… (compare)

  • Jul 19 14:10
    kevinresol opened #131
  • Jul 19 14:09

    kevinresol on safe-nav-nullable-object

    More tests (compare)

  • Jul 19 14:07

    kevinresol on safe-nav-nullable-object

    Safely navigate nullable objects (compare)

  • Jul 19 07:32
    kevinresol opened #130
  • Jun 22 16:33
    dependabot[bot] labeled #150
Juraj Kirchheim
@back2dos
good luck ;)
Thomas J. Webb
@thomasjwebb
woohoo! And same
Peter Achberger
@Antriel
Thanks. :)
Peter Achberger
@Antriel
Is there some pattern for having modifiable structures inside tink's State? I vaguely remember seeing that somewhere.
Would like to have some single State<Point> instead of individual x/y Float components.
serjek
@serjek
you'd want to use mutable structures in State?
I can suggest https://github.com/kevinresol/coconut.ds or ObservableArray or ObservableMap from tink.state whatever suits you best
Peter Achberger
@Antriel
Really just a State<{x:Float, y:Float}> that wouldn't allocate new object on each change. Maybe with something like state.set(x, y) but I'm not sure how to implement that.
Kevin Leung
@kevinresol
You can probably create something with SignalObservable
but you can't really have an Observable<T> where T is mutable
so I am not very sure if that is possible
how about {final x:State<Float>, final y:State<Float>}?
Peter Achberger
@Antriel
That's essentially what I have now. I just wanted to make it look nicer.
I don't see why it wouldn't be possible, just the invalidation would need to be assured somehow. I wonder why I thought I remembered seeing it somewhere.
One generic approach that comes to mind would be having inlined function for changing the value, that takes a callback for changing the value. I think I'm overthinking at this point. :)
Kevin Leung
@kevinresol
it is not really impossible but that just breaks the assumption of immutability, so something unexpected may happen down the stream
Peter Achberger
@Antriel
Yeah, I meant implemented in a way that guards the assumptions.
Kevin Leung
@kevinresol
I think SignalObservable is the easiest way to create a custom observable
you just fire the changed signal to let it know the value changed
constructor of SignalObservable basically take 2 arguments:
get: ()->T, changed:Signal<Noise>
Peter Achberger
@Antriel
Hmm, didn't know about that one, will check it. Thanks. :)
Kevin Leung
@kevinresol
yeah you get the idea from the ctor signature, a get function to obtain the value and a changed signal to notify the implementation when a change occurs
pretty straightforward
Peter Achberger
@Antriel
Sounds good.
I wonder if I will eventually want to improve performances on these things. Right now I don't care, but eventually I might need to go away from neat code and do optimized one. Who knows. :)
Juraj Kirchheim
@back2dos
you'll probably have a hard time with this ... if the value of an observable doesn't change (which it won't if you always have the same point), bindings won't fire (and even dependent auto observables will bail out of recomputing)
composing a bunch of states makes sense here ... you could do something like this:
class Point {
    public final xState:State<Float>;
    public final yState:State<Float>;

    public var x(get, set):Float;
        inline function get_x() return xState.value;
        inline function set_x(param) return xState.value = param;

    public var y(get, set):Float;
        inline function get_y() return yState.value;
        inline function set_y(param) return yState.value = param;

    public function new(x, y, ?comparator) {// comparator can be used for precision
        this.xState = new State(x, comparator);
        this.yState = new State(x, comparator);
    }
}
which is not that far from what coconut.data does ^^
Peter Achberger
@Antriel
I suppose that kind of abstraction works too.
Wouldn't the signal approach override the issue with object itself being the same?
Juraj Kirchheim
@back2dos
nope ... the signal pretty much changes nothing
Peter Achberger
@Antriel
Yep, tested it out, went with the Point wrapper. Thanks. :)
Juraj Kirchheim
@back2dos
sure ;)
Peter Achberger
@Antriel
Syntax hub ordering is just on per-type base, right? Not all types per plugin.
There's no good way to force that somehow, i.e. trying to depend on some types being done typing before finishing typing of this type?
serjek
@serjek

hey guys I have a question out of a sudden. not really related to tink but my project uses tink, so why not.

so, let's imagine, I have a nodejs server and it has multiple instances of "rooms" where players gather and play. And one of those rooms experinces an error thrown, which results in all server shutdown-restart cycle. Apparently it leads to poor UX for all active users on the server which I don not want. So the question is - how to I stop the error thrown from bubbling up and contain it only to the instance of the room where it was originated? And probably just silently report the action it caused, restarting the room from non-faulty step, so that users won't notice anything?

5 replies
Peter Achberger
@Antriel
Is there some usable pattern for defining multiple types from a single build macro, in a way that works with completion cache, and manages to invalidate the other defined types before running the build macro again?
I'm doing the silly thing where I force type (via Context.typeOf(expr)) all the types I need, to trigger their build macros, which fills the data I need to then build more types for them all. But obviously that's... not ideal. :D
Thomas J. Webb
@thomasjwebb
There’s still space for at least on 30 minute talk and one 15 minute talk at my mostly online event if anyone is interested. August 1st 9am-noon PDT (GMT-7)
Thomas J. Webb
@thomasjwebb
Does tink_template still work? I just ask because the last commit was 2 years ago and that failed on travix.
Kevin Leung
@kevinresol
I assume so until someone says otherwise and raises an issue :joy:
Thomas J. Webb
@thomasjwebb
I like those odds
serjek
@serjek
I use it nowadays here and there for static pages in blog
Thomas J. Webb
@thomasjwebb
I'm probably going to use it for something later today
logo
@logo4poop:matrix.org
[m]
Not sure if I can ask help for Why stuff here, but I'll try. I am using why-qrcode like so, however I am getting the runtime error Uncaught bad rs block @ typeNumber:1/errorCorrectionLevel:undefined. I don't think I am doing anything out of the ordinary?
        var encoder = new JsEncoder();
        var printer = new OpenflPrinter();
        encoder.encode("test")
            .next(printer.print);
kevinresol (Kevin Leung) You are probably the only one who is able to respond to this as you are probably the only person who has used this library lol
logo
@logo4poop:matrix.org
[m]
Figured it out, I needed to set the error correction level
Kevin Leung
@kevinresol
haha tbh I haven't been using it for some time already. Nice to hear you figured it out otherwise I am not sure if I still remember the details
logo
@logo4poop:matrix.org
[m]
I might need to make a PR to set a default
Or maybe just make it mandatory to set it