

Circa is a programming language for live coding, in development - barrybe
http://circa-lang.org/about/introduction.html

======
ique
How can you have a website displaying a live-coding language, without a video
displaying someone actually live-coding? :P

Seriously though, I'd love to see a video of someone doing live-coding. I've
been looking for a good live-coding environment ever since I found fluxus[1],
and subsequently found out that development of it had stopped.

[1] <http://www.pawfal.org/fluxus/>

~~~
paulhodge
That is an excellent point. I have some videos up
(<https://vimeo.com/user6866395/videos>) but I neglected to add them to the
new site.

~~~
pestaa
Wow, hats off to you. I love the part when it watches cpp files for changes,
recompiles and then uses the library to patch the live application.

Who said C++ is not productive, please? Alright, all credits goes to Paul. :)

~~~
paulhodge
Yeah, that was a fun hack! I think live C++ recompilation is something that is
occasionally theorized about, but rarely attempted.

------
rbxbx
Obligatory mention of "Inventing on Principle" by Bret Victor
(<https://vimeo.com/36579366>) which explores a lot of similar turf. With
Circa though we get to have these things today though, and with C integration
to boot. Great work.

------
drostie
I initially shrugged and said "gee, another programming language," but as I've
been looking, I just see more and more to squee about.

They aren't the decisions I'd have made but they're good decisions. The
inlined state stuff especially looks exciting and clever.

~~~
pestaa
True, I was also hesitant to check out the site. Glad I didn't resist the
temptation!

------
drobilla
Significant whitespace in a live coding language? I like and use Python, but
that seems like a show-stopper of a bad idea for a language designed for
throwing code around in real time.

~~~
iandanforth
Can you expand on this? If I get my indentation wrong then it will be obvious
very quickly. I'm guessing that it will only update if the basic syntax is
correct though.

~~~
technomancy
> If I get my indentation wrong then it will be obvious very quickly

Not if the language allows you to mix tabs and spaces; in that case semantic
details can be invisible.

------
tikhonj
Using # for both comments and colors does not sound like a good idea! Just
stick to --, I think. It looks prettier anyhow :P.

Also, how do you do scoping without a var or val keyword? E.g. what if I want
to have a variable local to a function (or method, I guess?). Or what if I
want to reassign a variable outside of the current scope?

~~~
paulhodge
Definitely a good point and I'll make that change. I was hesitating to only
use -- because I thought it might be unfamiliar to some. But it works great
for Lua & Haskell!

For variable scoping, if you use the same name inside a "for" or "if" block
then it'll assign that name in the outer scope. A function however can't
assign to names outside of the function - each function needs to explicitly
declare its inputs & outputs. There's some holes in the current design, so
adding a "val" keyword is the current plan.

------
skaushik92
I wish more languages had the right-apply function. It looks similar to piping
and sounds great.

------
jonasb
Anyone got it working?

I managed to compile both build/circa and build/circa_d (build/circa_t is
broken).

    
    
      circa ➤ export CIRCA_HOME=`pwd`
      ~CIRCA_HOME ➤ export PATH=$PATH:$CIRCA_HOME/build
      ~CIRCA_HOME ➤ python tools/prebuild.py
      ~CIRCA_HOME ➤ scons build/circa build/circa_d
    

I can run the tests:

    
    
      ~CIRCA_HOME ➤ tools/ca-tests.py
      Ran 105 tests, 0 failed, 11 disabled.
    

But I can't launch the repl (circa_d --repl) nor get anything from the
samples. On some of the samples I get errors, on others I get nothing.

Am I missing something?

~~~
paulhodge
For the repl, can you try "circa_d -repl" (one dash instead of two)?

There is definitely some breakages in there, and most of those samples won't
run currently. I'm rewriting the app that runs things in a graphical shell and
I hope to have that ready soon. If you are feeling brave, you can go back in
time to use Plastic (the SDL-based shell that I was relying on for a while).
Instructions for that:

Checkout revision efb5300

Delete the files at src/generated/*.cpp and run prebuild.py again

scons build/plas_r (this will require SDL)

Launch with: build/plas_r samples/asteroids.ca (or some other sample)

~~~
jonasb

      circa_d -repl
    

This works fine. Not sure why I used -- :-)

With that version I can build build/plas_r but there are some missing Box2D
files. Might come back to it later when I have more time or when the the next
app is out :-)

The project looks awesome btw! :-)

~~~
paulhodge
Thanks! Yeah, might as well wait for the next release rather than debug an old
version.

------
zmmmmm
I always wonder why so many languages eschew multiline comments. Is it
monumentally harder to make a parser that supports it or is this a conscious
decision?

~~~
paulhodge
It's not too hard, it was just a combination of laziness plus not being able
to decide on a multiline comment syntax that looks nice. Anyway I just added
it, using {- and -} separators (as in Haskell)

~~~
zmmmmm
Ah, interesting :-)

I was just curious since there seem to be a few languages that only have
single line comments. But usually it just results in people finding "hacks" so
they can make them anyway (like Python's doc-strings) which just ends up being
uglier than supporting them natively.

------
vasco
When I saw the wall appear and get moved I instantly thought about some
variation of a programmers pong of sorts. Or other games!

------
pinchyfingers
Code reflection seems like an awesome feature to play around with, and it
seems really cool that you can modify the AST and have the changes saved back
to the source text.

Until Cicra is ready, where else can I learn to use these features?

------
iandanforth
I really like this! One thing that wasn't shown is having variables in the CPP
code get modified from in game. Would that be possible?

~~~
paulhodge
Definitely possible, though you would store those tweakable variables in
special MyVariable objects (rather than have them be normal C++ variables).
With Circa you could grab the object that holds then variable's data, and then
have C++ code that reads it as often as you want.

Game devs love to have tweakable variables, so there's a lot of libraries that
will help with this. One example:
<http://www.antisphere.com/Wiki/tools:anttweakbar>

