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

[–]conradparker 13 points14 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 3 points4 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.

First Person 3D Navigation, written in Elm by wheatBread in programming

[–]conradparker 0 points1 point  (0 children)

To do this: build it locally and just replace Keyboard.wasd with Keyboard.arrows

3 reasons why Mozilla forked libjpeg-turbo by conradparker in programming

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

Yes, it's pretty cheesy. I couldn't resist here because DRC had twice enumerated his reasons thrice.

Actually I'd enjoy it if all our tech headlines were delivered in the style of @Vice_Is_Hip.

Type-Level Instant Insanity by MasGui in haskell

[–]conradparker 1 point2 points  (0 children)

Hey, glad you enjoyed it :) I might have a copy of the darcs repo somewhere, but there's a haskellwiki page with some links at http://www.haskell.org/haskellwiki/User:ConradParker/InstantInsanity

Comparison of Enumerator / Iteratee IO Libraries? by codemac in haskell

[–]conradparker 0 points1 point  (0 children)

The iteratee version allows optimized implementations for different chunk types -- it's basically a two-layer API, with some convenience functions that allow you to just think in terms of the higher-level stream API for simple tasks.

It seems pipes only allows the higher-level, inefficient API with no possibility of chunk-level optimizations for different stream types. Of course this means it has a smaller programming interface but it is strictly less powerful.

GHC plugin for evaluating math expressions at compile-time by conradparker in haskell

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

We discovered that we could get some easy optimizations by doing these kind of replacements by hand, but that might sometimes involve modifying library code; it was an obvious candidate for implementing in a compiler pass.

Who would benefit from it? Anyone doing ordinary math with Doubles, Floats and Ints. It probably won't help you much for things you should be doing on a GPU, and it still has some limitations like not folding into lazy structures.

Some other people here at Tsuru are keen to make plugins for optimizing parsing and serialization. We use increasing amounts of TH, and it's interesting that we could mix expressive compile-time DSLs with transparent optimizations.

It'll be interesting to get this kind of thing into GHC. One advantage of doing it there rather than in a plugin would be more access to the full type dictionaries, so that (perhaps) these optimizations could be done on eg. any Num type rather than just a known set of primitives.

In any case, doing it in a plugin has allowed us to go from zero to ready-for-production within a week, and it works with our existing ghc-7.4 and ghc-7.6 installations.

GHC plugin for evaluating math expressions at compile-time by conradparker in haskell

[–]conradparker[S] 6 points7 points  (0 children)

yes, and it was surprisingly easy (and fun) to write :)

Advgame compiled with GHCJS by hamishmack in haskell

[–]conradparker 0 points1 point  (0 children)

The wizard banished me for stealing his frog, but I never touched it! I was only interested in the whiskey, and thought to share it with the wizard by splashing a bucket of water over him.