HackerTrans
TopNewTrendsCommentsPastAskShowJobs

gw

no profile record

Submissions

Show HN: Ansiwave, an ANSI art and MIDI music mashup

github.com
103 points·by gw·5 ปีที่แล้ว·14 comments

Show HN: O'Doyle Rules – a new rules engine for Clojure

github.com
100 points·by gw·6 ปีที่แล้ว·18 comments

comments

gw
·5 ปีที่แล้ว·discuss
Is it a "javascript application" or a "page with text that uses javascript for dynamic features"...
gw
·5 ปีที่แล้ว·discuss
Y'all both are making great tools but consider giving a read-only view of the page when javascript is disabled. After disabling JS this gives me a blank white screen: https://athensresearch.github.io/athens/ Same thing when i tried it with roam.
gw
·5 ปีที่แล้ว·discuss
You sure? https://forum.nim-lang.org/t/4022#25046 edit: the docs seem to say you're right, maybe that forum post is outdated but it's from nim's author.
gw
·5 ปีที่แล้ว·discuss
Not the commenter but which one of these is the defer generating?

    // option 1
    try {
      fp = os.open(x)
      fp.read()
    }
    finally {
      fp.close()
    }

    // option 2
    fp = os.open(x)
    try {
      fp.read()
    }
    finally {
      fp.close()
    }
Should we close if open fails? Maybe, maybe not, but with try/finally it is obvious which one it is doing.
gw
·5 ปีที่แล้ว·discuss
Nim's defer just wraps the current scope in a try/finally, with the deferred code running in the finally. It is probably better just to use try/finally directly because it's more explicit about what is in the try block. It's not worth it to obscure that just to avoid a new level of indentation...
gw
·5 ปีที่แล้ว·discuss
You can still hold on to references to textures and meshes you uploaded to the GPU without using a full-blown scene graph. Some state is necessary no doubt, but this seems more like unnecessary state that could be replaced by something more direct. But i don't know, i'm not familiar with three.js; the click handlers seem useful.
gw
·5 ปีที่แล้ว·discuss
That makes sense, but it seems like a case of building an abstraction to solve a problem caused by another abstraction. If a scene graph creates a new chore for me that necessitates yet another dependency, i think it'd be simpler to not fuss with these layers at all. That's a choice i don't have with the DOM.
gw
·5 ปีที่แล้ว·discuss
That looks neat but why would you need a react-style reconciler to render a webgl scene? It's immediate mode...every frame is rendered according to the latest state available. What is even being reconciled?
gw
·5 ปีที่แล้ว·discuss
Crawford says nobody truly followed in his footsteps but I think Jason Rohrer qualifies. The two even shot a documentary together, and the scene where Crawford showed off his Storytron project to Jason was pretty revealing. Jason called it baroque and Crawford responded that he'd consider his life a failure if the project fails:

https://www.youtube.com/watch?v=zA_0_dSD3-Q&t=27m35s

Crawford definitely is not doing enough introspection. I hope the man resets and makes an inspiring project without the self-romanticizing or self-pitying.
gw
·6 ปีที่แล้ว·discuss
Yeah it's a bit bifurcated. Internally there's a lot of coupling -- HTML embedded directly in the C code and whatnot. This could be resolved if tools could be built on top of fossil, but the CLI code uses `exit` everywhere which makes it impossible to use as a library. I think they made an incomplete attempt at a JSON API, but what you really need is a proper linkable library like libgit2.
gw
·6 ปีที่แล้ว·discuss
It would at least be far less of an issue. I don't see anyone being confused that https://github.com/facebook/react is the official repo, and not https://github.com/react/react. It's the fact that a collapsed name is a shortcut that imbues it with this special stature. And i believe maven central doesn't even allow one-segment group names for new libraries, though clojars obviously does.
gw
·6 ปีที่แล้ว·discuss
I wasn't even addressing the crates.io team, i was addressing the author of the post.
gw
·6 ปีที่แล้ว·discuss
The quote was a guideline, not a requirement. Cognitect (who makes the clojure CLI tool) doesn't even control clojars, the main clojure maven repo, so they wouldn't be able to enforce that even if they wanted to.
gw
·6 ปีที่แล้ว·discuss
I didn't choose the shorter names because i "care[d] about having shorter names", i did so defensively, because i figured if i chose `net.sekao/iglu`, someone else would choose `iglu/iglu` which would imply that theirs was the original or official version.

Another point i didn't mention is that maven was designed from the start to be decentralized; many companies run their own private maven repos, but also pull artifacts from maven central. Having group names reduces the chances of collisions between their private servers and a public maven server.
gw
·6 ปีที่แล้ว·discuss
You really should look to other ecosystems and see what lessons they've learned. In java, packages are normally "namespaced" by the author's reverse domain name, like `org.lwjgl/lwjgl`.

Since clojure uses maven as well, the same applies, but clojure tools like leiningen decided to create a shortcut: if the group and artifact name are the same, like `iglu/iglu`, they can be collapsed into one name: `iglu`

Well, that just encouraged everyone to choose collapsible names. In retrospect, this didn't buy us much. Who cares about saving a few characters of typing? Most now seem to agree it wasn't a good idea.

When the "collapsed" name falls out of maintenance, the forks will all seem somehow less "official", even if they are much higher quality. Forks are inevitable; why would you want to discourage them?

I finally decided to start using the reverse of my personal domain for my future libraries. The java folks were right all along.
gw
·6 ปีที่แล้ว·discuss
I think the instrumenting and generator stuff gets disproportionate attention. For me by far the biggest win from spec has been with parsing. This completely changes how you'd write a library that takes a data structure and parses it into something meaningful (for example, what hiccup does for html or what honeysql does for sql).

In the past, this required a lot of very ugly parsing code and manual error-checking. With spec, you write specs and call s/conform. If it failed, you get a nice error, especially if you pair it with expound. If it succeeded, you get a destructured value that is really easy to pull data out of. I've done this in a half dozen different libraries and i'm pretty sure i wouldn't have even written them without spec.
gw
·6 ปีที่แล้ว·discuss
Deprecated, not removed. In fact opengl will still be supported in the new ARM macs.
gw
·6 ปีที่แล้ว·discuss
Interesting. When you say "save and restore state", do you mean actually serializing it and loading it later? In what situation would you want to do this? Not doubting that there is one but i haven't heard of this before.
gw
·6 ปีที่แล้ว·discuss
Webgl doesn't have this problem since it runs those functions on a context object. But yeah i wish there was a way to do that with opengl.
gw
·6 ปีที่แล้ว·discuss
It is pretty wild, though mine wasn't quite as bad. It ended up clocking in at 650 lines. I guess part of that is because nim doesn't have braces... https://github.com/oakes/vulkan_triangle_nim/blob/master/src...