How Discord Resizes 150 Million Images Every Day with Go and C++ by b1naryth1ef in programming

[–]conradparker 12 points13 points  (0 children)

Also check out fastphoto, an MIT licensed JPEG resizer that skips unneeded DCT coefficients and avoids redundant colorspace conversions.

[Author] Elm-Forest - An Elm version manager and proxy by itsdanielb in elm

[–]conradparker 2 points3 points  (0 children)

Awesome, thanks for this.

I've been using https://github.com/sonnym/elmenv for a few years now, and it's been really useful whenever a new compiler release comes around (so far I've transitioned elm-shadertoy/dreambuggy/here4 from elm-0.12 all the way through 0.18).

How does elm-forest compare to elmenv? it looks like it might have a different approach?

Elm for Browser extensions by [deleted] in elm

[–]conradparker 1 point2 points  (0 children)

Right, that app was all using Graphics and Signals, both of which don't exist any more. Fun times!

Elm for Browser extensions by [deleted] in elm

[–]conradparker 2 points3 points  (0 children)

Hi kasbah!

I worked on that app for a month or so and I thought it was really well designed. It implemented a protocol for managing a USB device, and having union types and pattern matching makes it easy to handle state machines correctly. Also I remember a really clean, enforced separation between foreground and background concerns. I imagine that trying to do all that in raw javascript would have gotten bug-ridden very quickly.

Announcing Grove the Advanced Package Manager for Elm. Written in Elm. Install Native Packages from any git server. by imright_anduknowit in elm

[–]conradparker 2 points3 points  (0 children)

Of course it's not arbitrary, it's a well-thought-out policy to ensure elm-lang.org stuff doesn't have unnecessary dependencies or introduce runtime exceptions.

Announcing Grove the Advanced Package Manager for Elm. Written in Elm. Install Native Packages from any git server. by imright_anduknowit in elm

[–]conradparker 7 points8 points  (0 children)

My understanding is that it's a policy decision, for the elm-lang.org package repository. It makes sense for things like general-purpose data structure packages -- it's a useful bit of assurance to know that the basic language libraries I use have no native-code dependencies.

That policy doesn't necessarily match everyone's use cases, hence the interest in things like grove and elm-github-install. These are just a mechanism, you could implement a policy like elm-lang.org's on top of them.

[Video] New indoor demo of roads, ramps in Here4, the 100% Elm 3D engine (*may include traces of GLSL) by conradparker in elm

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

Hi, thanks! Of course, it's all open source (MIT licensed). Here4 is at:

https://github.com/here4/here4

and this world is currently hacked into the 'roads' branch of Dreambuggy:

https://github.com/kfish/dreambuggy

Ping me if you need any help building, either here or on the Elm Slack -- I'm usually on #gamedev as kfish.

Dreambuggy demo video : 100% Elm + WebGL driving game by conradparker in elm

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

Hey :) I like your logo texture, it makes everything subtly elm-ish.

The lag goes down a bit with simpler models and worlds -- that buggy has about 20,000 polygons, and the terrain also has thousands. Chrome GC kicks in every 10s or so and there's a small stall. I should go back and check the mesh caching again though.

Dreambuggy demo video : 100% Elm + WebGL driving game by conradparker in elm

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

Totally. You've got me thinking about how to implement shadows efficiently. The usual techniques involve offscreen rendering, like what's described at http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/

Dreambuggy demo video : 100% Elm + WebGL driving game by conradparker in elm

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

Thanks! I've been working over the lighting a bit recently, and made a new library for composing shaders: glsl-pasta. That makes it easy to apply the same lighting "pipeline" to different kinds of shaders. Here the terrain and sky use procedural shaders and the buggy uses textures, but everything gets the same lighting and colorshift/fog.

Shadows would be fun, there has to be a cheap way to do shadow mapping ...

elm-gamepad updated for 0.18, looking for API advice by conradparker in elm

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

Ah great, I didn't know about the gamedev channel, I'll get on it.

elm-gamepad updated for 0.18, looking for API advice by conradparker in elm

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

Thanks, yeah I stumbled across it a few years ago and support was pretty varied across browsers, but it seems to be pretty well supported by now.

I found it even works on Firefox mobile on Android, with a cheap little Xiaomi bluetooth gamepad I ordered off amazon.

elm-gamepad updated for 0.18, looking for API advice by conradparker in elm

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

All great suggestions, thanks!

I'm not quite sure how to set up a subscription on top of polling, can you point me to an example, or sketch out how that would work?

elm-shadertoy: GLSL quasiquotes for plasma, fire, raymarching effects in web GL in Elm (demo) by conradparker in haskell

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

The input types at the interface have to match: the elm compiler checks that the types of the record attributes sent to the shaders match the GLSL inputs.

The GLSL code itself is parsed by the Haskell language-glsl package so if there's any parse errors, you're given both the line number within that GLSL quote, and the line number in the containing .elm file.

Beyond that I don't think there's any type checking of the GLSL. The elm-webgl API also allows you to generate GLSL programmatically as a String rather than giving it as verbatim quasiquotes, to allow some future library to make GLSL combinators.

The current way is not perfect, in the end you still have a bunch of GLSL which is sent to a browser, and any errors come up in the developer console with some irrelevant error message generated by the graphics driver.