
Bret Victor's live editable game in ClojureScript - ibdknox
http://www.chris-granger.com/2012/02/26/connecting-to-your-creation/
======
zackzackzack
Applying this to more than just games, you could probably make a really good
tool for mathematical modeling of physical situations. Speed would be an
issue, but it would be a good way to test out ideas quickly.

~~~
asolove
This idea is the subject of Bret's essay "Up and down the ladder of
abstraction" [1] which is a fantastic read.

[1] <http://worrydream.com/LadderOfAbstraction/>

~~~
zackzackzack
I remember geeking out to that when it came out! Since reading that I have
been playing around with d3 a good deal to try and be able to make some of the
stuff he has. I've been slaving away at this for the past few days actually:
<http://zacharymaril.com/analytics/>

This afternoon, I will put up a better version (this one won't work for you
due to some figuration stuff), but this takes in your google analytics data
and maps it a bit better than the normal set up.

------
bjconlan
Wow that is a great example! Kudos Chris.

I would also like to point some of the commenters to (fluxus)
<http://www.pawfal.org/fluxus/>. It is a very nice example of this concept of
the same thing, only using racket/plt scheme.

Live coding/reactive code are fantastic little ideas which I wish had been
exposed to me earlier in my career.

------
amasad
ClojureScript compiler being written in Clojure is a huge disadvantage. It
should be written in JavaSript or ideally self-hosting. That way for this
project you wouldn't need the server and when its hosted somewhere there is no
need to the compile round-trip each time the code changes. Also as a plus
you'd have eval!

~~~
swannodette
self-hosting only gets you bragging rights and neat demos - it offers little
advantage for real applications targeting JavaScript. That said, ClojureScript
now implements most of Clojure - if someone wanted to bootstrap ClojureScript
for fun it wouldn't be much work, go for it.

~~~
amasad
"I didn't put it up on heroku because the latency kills the real-time aspect
of it."

There is your advantage, if it was self-hosting then this wouldn't be an
issue.

~~~
swannodette
Advantage for a beautiful _demo_. If I'm going to actually build real
applications in this way, I don't need to run my development environment on
someone else's website.

~~~
amasad
Maybe you don't but many people do prefer coding on the web. There is some
very good web IDEs out there. e.x. <http://c9.io/>

Also you haven't mentioned eval anywhere in your argument. Don't you think a
lisp should have an eval?

~~~
gtrak
This was beaten to death on the release of clojurescript. I think the
consensus is it's not worthwhile, since there are real benefits to google's
closure compiler, optimization, and dead code elimination. But there's nothing
stopping you from implementing it?

~~~
amasad
You're right I should put my code where my mouth is!

As for closure compiler, uglify-js is an obvious replacement, it does all the
optimizations, dead code elimination. It only falls short with inlining.

------
jisaacstone
Awesome and Awesome.

Looks like today is the day that I learn clojure! ^^

------
brown9-2
Do you guys think Bret Victor built an actual editor for his "live editing"
demo, or just build enough of a demo to illustrate his principle?

It seems to me that if what he had built was a real editor (i.e. could be used
for more than just his Braid demo game), there would be immense value in
releasing/selling it.

~~~
grinich
Sometimes the seed of an idea is more important to get right than the finished
product.

~~~
vdm
Reply: <https://twitter.com/worrydream/status/174204355220738048>

------
nileshtrivedi
After I saw this talk, I thought about what it would take for making such an
editor for general-purpose programming (and not just drawing or simulations).

I came up with this basic UI concept: <http://livecoding.staticloud.com/>

~~~
vdm
That's exactly what I had in mind for running tests, I think you're definitely
on the right track. Great work!

------
nodemaker
Bret's talk has the potential to transform lives.

But anyone has any idea how to do something like that on iOS/Xcode?

------
ibdknox
I just added a downloadable jar for it as well:
<https://github.com/ibdknox/live-cljs/downloads>

    
    
      java -jar live-cljs.jar

------
etcet
This is really cool. One problem I've noticed with real time evaluation is
infinite loops. I've played with an realtime javascript editor/evaluator and I
inadvertently locked the browser (and the editor) when writing code. Imagine
writing a "while (true)" loop and it evaluates before you've finished the
break condition.

~~~
deniska
If simulation runs (and it should) in the different thread, then nothing bad
happens.

------
Gotttzsche
hmm, when you unpause, the player just falls straight down rather, ignoring
the velocity it should have.

also, in the talk the player's path was projected into the future, iirc, not
just showing the past

~~~
ibdknox
He rolled the player back, so it wasn't projected into the future, it was just
he adjusted the current position backwards. you fall straight down because
your velocity is dependent on whether or not you have the key pressed. Jump
and let go of the arrow.

------
Tim-Boss
I haven't quite yet recovered from a weekend of sleep deprivation, and was
entirely disappointed to learn that the link was for an "editable game", not
an "edible game"...

------
recurve7
I notice in your Overtone + ClojureScript screencast you were using VIM on
Mac, but this looked different. Are you using SublimeText here or Noir itself
as the editor?

~~~
recurve7
Also, what editor/tools do you recommend for general Clojure, ClojureScript,
or Noir development and why?

------
gncvalente74
amazing !

