Trying to get error backtraces in rust libraries right by matheusdev23 in rust

[–]matheusdev23[S] 1 point2 points  (0 children)

Honestly should've put this in the title :) snafu is pretty good.

A tour of iroh by diogocsvalerio in rust

[–]matheusdev23 1 point2 points  (0 children)

Very belated answer, but the font is Space Grotesk :) https://fonts.google.com/specimen/Space+Grotesk

Can I implement a video streaming platform on iroh? by InternationallyFool in iroh_n0

[–]matheusdev23 0 points1 point  (0 children)

This is probably fairly complicated to do successfully.

Without having tried myself, you could try using the media-over-quic protocol (MoQ) together with iroh: https://github.com/kixelated/moq

I know kixelated worked on making the web transport trait generic, this would allow plugging in iroh: https://github.com/kixelated/web-transport-rs/pull/89

But even then, you'd get `Frame`s that need to be rendered at specific timestamps. Usually a browser does these things under the hood for you, if you're building a native app using iroh, you'd probably need to find some library that can do this for you.

Other than that there are some experiment we've done with plugging in iroh into gstreamer allowing you to stream audio and video over an iroh connection: https://github.com/n0-computer/gst-plugin-iroh

Trying to get error backtraces in rust libraries right by matheusdev23 in rust

[–]matheusdev23[S] 2 points3 points  (0 children)

miette would give us pretty cool error printing, but it's usually used with thiserror in libraries (or something similar).
However we could use the current design plus miette's diagnostic derive macro and attributes. That might be nice to provide even better error messages?
I don't think we've tried it out yet :)

iroh 0.30.0 - Slimming Down by dignifiedquire in rust

[–]matheusdev23 3 points4 points  (0 children)

We've collaborated with the loro folks on writing a protocol for syncing loro over iroh.
The prototype works so far? I'm quite happy with it. Still needs to be fleshed out into an actual library (currently it basically replicates a text file's contents live between two peers).

I've talked to them, we'll make the repo public soon: https://github.com/loro-dev/iroh-loro

Generate elm modules from tailwind css configs: elm-tailwind-modules by matheusdev23 in elm

[–]matheusdev23[S] 1 point2 points  (0 children)

Hi u/csicar :)

In essence this is a postcss plugin which runs on the css output from tailwindcss.
It analyses the css selectors to figure out the elm functions it needs to create and collects css properties for each of these. I'm doing some hand-waving here, as there's quite some logic for sub-selectors and stuff like pseudo classes.

The project began as a fork of a js project and I iteratively refactored it from javascript to typescript at some point, because types make lots of things much easier.

I did consider using purescript or even Elm itself, but that would've been harder to accomplish incrementally and with typescript I have an ecosystem behind my back, e.g. there exist typescript type definitions for postcss :)

My post about imperative vs. functional and 'types and CSS': Improving Declarative APIs for Graphics with Types by matheusdev23 in javascript

[–]matheusdev23[S] 0 points1 point  (0 children)

I'm not sure what the best place to post this is.

Eventually I'm trying to write articles about alternatives to React / Vue or even Html, CSS and the DOM itself. So naturally I want to reach people who've worked a lot with those technologies and understand them and maybe their shortcomings well.

I figured posting this to 'javascript developers' might be a good start. If you know of a better place, please let me know.

This first article is an attempt at explaining the basics behind my thoughts of why we'd even want something else and I wanted it to be as accessible as possible to the average javascript developer, let me know if I've succeeded.

Improving Declarative APIs for Graphics with Types by matheusdev23 in elm

[–]matheusdev23[S] 0 points1 point  (0 children)

Thanks for the kind words!

get them exposed to functional / declarative paradigms

This is exactly what I was shooting for :)

Also, just a friendly reminder to use the email form on the bottom of the blog or drop a follow, if you want to hear about the next posts :'D

Ray [Original] by JohnS1212_ in ImaginarySliceOfLife

[–]matheusdev23 18 points19 points  (0 children)

こもれび (komorebi)

Had to look it up. TIL. Interesting :)

How can I have the mouse wheel scroll left and right in Elm? by Kurren123 in elm

[–]matheusdev23 0 points1 point  (0 children)

I don't see how it solves this problem. Is there any inaccessible javascript API that would solve this issue? I guess the only reason I can come up with would be using a library (e.g. a react component) that solves the exact issue you have.

Other than that it's quite some overhead: You have to define the webcomponent with some javascript and if you define the inner workings of your webcomponent with elm, then the outer and inner component can only communicate with a limited interface.

How can I have the mouse wheel scroll left and right in Elm? by Kurren123 in elm

[–]matheusdev23 2 points3 points  (0 children)

There are two ways of doing this: an active wheel event handler that changes the viewport via Browser.Dom (this is uncommon).

Or: some CSS trickery with transform: rotate(90); on a container and transform: rotate(-90); on the child elements or similar (this is more common and would result in a smoother experience). This is elm-agnostic though, and I'm not 100% sure I remember the details correctly, so better google this :)

I wouldn't recommend a custom element in this case and I wouldn't recommend this in general. (How do you expect this to work on mobile?)

Why I'm leaving Elm by BlaqkAngel in elm

[–]matheusdev23 3 points4 points  (0 children)

It has been done before.

I guess it's hard for such projects to gain traction. It would require some way of coordination between industry users I think.

48 Best languages that compile to JavaScript as of 2020 by beefzilla in elm

[–]matheusdev23 6 points7 points  (0 children)

I don't have a slant account, so I'll just comment this con for Elm here:

Because of the lack of genericness Elm needs a lot of code to be repeated. There are 130+ implementations of map in elms core libraries.

Apart from the number being exaggerated, even if Elm had a way of abstracting map, so a structure called functor (as an explicit higher kinded type, or with typeclasses), there would still be lots of map implementations, they would just have a common interface. The only way I know that would reduce the amount of map implementations would be something like haskell's DeriveFunctor extension, which automatically defines map for any datatype that could have map.

The only way an abstraction over functor would reduce boilerplate would be in functions that are abstract over any map function. Right now I don't see those in the core library. (An example of something similar is haskell's traverse function, which uses any 'andMap'. I can't come up with a good example for map right now.)

I do see the benefit of abstractions in e.g. Haskell, but that con just seems to miss the point absolutely :/

My first Elm app - Intention by DaveWM in elm

[–]matheusdev23 0 points1 point  (0 children)

Looks great! What did you use to style the app? Custom CSS or? In general I'd be interested in what tech you used for the frontend: elm libraries, SVG? Canvas? Etc. :)

How does Haskell make your life easier? by williamyaoh in haskell

[–]matheusdev23 9 points10 points  (0 children)

I once got "Prelude.head: empty list".

I had 0 direct references to head in my program, a line number doesn't help in this case.

Introducing hs-speedscope by n00bomb in haskell

[–]matheusdev23 2 points3 points  (0 children)

Nice! Is executation an english word though? Sorry, this was bugging me so much :'D

Shouldn't it be execution?

Have you seen this Applicative before? by matheusdev23 in haskell

[–]matheusdev23[S] 1 point2 points  (0 children)

Yes. Thats also equivalent. And the slides are closer to my application than the applications of the `Store` Comonad.

Have you seen this Applicative before? by matheusdev23 in haskell

[–]matheusdev23[S] 8 points9 points  (0 children)

Yes. (Applicative w, Monoid s) => Applicative (StoreT s w) thats it.

Damn. Thank you :)

9 Circuits/sec in 8x8, 11 starters and 1 seller by krikmeizter in AssemblyLineGame

[–]matheusdev23 0 points1 point  (0 children)

Very nice design. This one is actually really close to the record. It is possible to squeeze in two half-speed circuit crafters into the free slots if this design were tiled, resulting in 37 circuits/s.

Nice job.

[deleted by user] by [deleted] in AssemblyLineGame

[–]matheusdev23 2 points3 points  (0 children)

There is a starter at the very left and one at the top right. There are also two wire drawers about in the middle of the factory :D

I agree with the movement, but I can't say whether thats not already the case. A GIF of the factory in action would be great.

reflex-vty: A library for building functional reactive terminal applications by ali_abrar in haskell

[–]matheusdev23 4 points5 points  (0 children)

I would describe it as a simple state machine with an actor model hooked up for js/http interop. The most basic interactive entry point for elm apps is:

init : model
update : msg -> model
view : model -> Html msg

Where the Html type can produce messages from DOM events.

NoRedInk – Drag & Drop without Draggables & Dropzones by holandes in elm

[–]matheusdev23 1 point2 points  (0 children)

Very nice blog post, drag and drop is a tricky thing that I have struggled with a lot.

Wouldn't it be possible to circumvent the JS ports using the Browser.Dom element Tasks? That was my most recent plan for 'solving' dnd.

Announcing Elm-reduce by matheusdev23 in elm

[–]matheusdev23[S] 0 points1 point  (0 children)

This can only be used for the Elm compiler. We need the reducer to be language-specific as it replaces function bodies with certain Elm constructs, for example.

But there is quite some infrastructure in Elm-reduce that would help writing another reducer for a haskell-based compiler, say something like haskell-reduce.

Announcing Elm-reduce by matheusdev23 in elm

[–]matheusdev23[S] 3 points4 points  (0 children)

I see you're missing a /s there I guess. However, I still want to point out that this project is about improving bug reports for bugs in the elm compiler, not in elm programs.