HNHacker News
TopNewBestAskShowJobs

takeoutweight

190 karma · joined May 15, 2011

submissionscomments
takeoutweight··on Takeoutweight - compiling Clojure to Scheme to C
ClojureScript is precisely a Clojure-in-Clojure implementation. All the AST analysis and code generation is done by Clojure, not by antlr et al.
takeoutweight··on Using AI to design board games
The problem of assigning a "fun value" to a game is an active area of research. Julian Togelius and Georgios Yannakakis are some of the big names looking at this topic right now.

One approach is to use tried-and-true statistical techniques to build models from user feedback. Often a player will be provided two variations of a game and asked which one was more fun. This input, combined with various other factors (how did the player perform? how many enemies were there in each version?) help construct some sort of classifier to automatically evaluate new game variations.

An alternate approach, which I explored during my Master's research on the topic, was to analyze existing levels in commercially released videogames to construct a model of fun from that, as opposed to considering subjective human feedback. I chose to analyse Super Mario Brothers. It turns out you can see a very characteristic pattern in how the difficult portions of the levels are arranged. This pattern of difficulty takes the form of a rhythmic interplay of difficult and easier portions, and can be nicely described in terms of Flow and the Yerkes-Dodson law. We used this a criterion for evaluating automatically generated levels as a part of a larger system.

The applications of this are pretty wide. Perhaps we could automatically evaluate web page interactions according to a certain model of fun to engage users? Perhaps we can detect when people are not having fun and automatically generate alternate designs?

takeoutweight··on Rich Hickey: "Simple Made Easy" from Strange Loop 2011 [video]
I fear you've missed the thrust of Rich's talk. Functional programming may seem "intricate" because it is unfamiliar, but if you're willing do do a little bit of up-front unlearning of the massively complex (but familiar) tools you're used to, you may find yourself able to work on projects of a much bigger scale and functionality.

See the slide at 17:20 -- easy stuff (perl,ruby, blurb) gives you 100% speed at the beginning of a project. If you don't expend effort into making things simple, you will "invariably slow down over the long haul."

takeoutweight··on When Not To Quit: Man Revived After 96 Minutes
It really should be logical implication '⇒', shouldn't it.
takeoutweight··on Clojure Pattern Matching Lib: literal, seq, map and other patterns
I saw guards mentions in the "notes" but no evidence in the TODO. Does guarded pattern matching work with your compilation strategy?
takeoutweight··on Compiling Clojure to Javascript, pt. 2 -- Why No Eval?
The term that describes what you are referring to is 'partial evaluation'
takeoutweight··on Compiling Clojure to Javascript, pt. 2 -- Why No Eval?
I'm not sure if we share the same notion of supercompilation. The whole point of supercompilation is to speculatively evaluate terms to supply branch-level constraints that propagate through the call graph, enabling program transformations such as inlining, dead code elimination, partial evaluation and deforestation. Whole-program transformations such as these are done during compilation (i.e. in the dev environment and not in production.) How would you retro-actively undo an existing transformed piece of code when a new form is observed by eval? How would you maintain a list of already-applied transformations to allow new code to be specialized? Supercompilation is not an incremental procedure.
takeoutweight··on Compiling Clojure to Javascript, pt. 2 -- Why No Eval?
You've described exactly why eval is antithetical to dead code elimination: you must defensively include absolutely every public function in every referenced library, because you do not know beforehand which functions an arbitrary evalled form will call.
takeoutweight··on Compiling Clojure to Javascript, pt. 2 -- Why No Eval?
Supercompilation is the precisely the tool that should not be used for compiling a dynamic language--it relies heavily on static analysis that are simply unfeasible in a dynamic language. eg: anything that touches a dynamically bindable var cannot be specialized--this dynamicity will essentially infect the rest of the functions in the call graph. This is especially true when you're staging compilation via eval. Supercompilation is very slow and memory intensive, and it would be insane to track variable specialization information throughout runtime.
takeoutweight··on JS is Assembly Language for the Web: Brendan Eich, Crockford, & others comment
Forgive me for parroting the thoughts of those smarter than me, but there was an engaging debate on Lambda the Ultimate recently on how terrible JS is as an assembly language: http://lambda-the-ultimate.org/node/4308#comment-66084
← PreviousPage 2 of 2