News for hackers. Stuff that matters.
Re:Brace : Dialect of C that looks like Python by lolcraft on Sunday November 08, 2009 @02:45PM (#929688)
More than a dialect, a skin over C which could use some syntactic sugar. let(a,1)? In my book "a = 1", not even "let a = 1". It could be interesting, but the examples are too LOGO-ish, it could do trivial "duck-typing" (does "int a = 0" really need the "int"?), and the trade-off of using an imperative language or using another imperative language _and_ using another compiler isn't worth it.
Re:Brace : Dialect of C that looks like Python by tumult on Sunday November 08, 2009 @03:27PM (#929748)
That's not trivial, suddenly you have to have type inference. 1? Did you mean an int? Float? Double? 8 bits? 16? 32? 64? signed? unsigned?
Re:Brace : Dialect of C that looks like Python by viraptor on Sunday November 08, 2009 @08:19PM (#930157)
> 1? Did you mean an int?

1

> Float?

1.0f

> Double?

1.0

> 8 bits? 16?

Those would actually need the type.

> 32?

1

> 64?

1ll

> signed?

1

> unsigned?

1u

C copiler already does that "inference" when you pass an attribute into a function - so why not when you declare the variable?

Re:Brace : Dialect of C that looks like Python by tumult on Sunday November 08, 2009 @08:41PM (#930194)
because you can write to a variable or pass it to more than one function
Re:Brace : Dialect of C that looks like Python by viraptor on Sunday November 08, 2009 @09:09PM (#930234)
So you can infer the type on the first usage only and then treat the variable like it has a static type (because it does). That's what most type-inferring, static languages do.
Re:Brace : Dialect of C that looks like Python by tumult on Sunday November 08, 2009 @09:24PM (#930256)
the really smart, immutable ones, could let you treat the expression as any of those types as you like. this is supposed to be a cleaner C syntax, not another platform.
Re:Brace : Dialect of C that looks like Python by pgbovine on Sunday November 08, 2009 @03:47PM (#929783)
yup, agreed. type inference for a dynamically-typed language is extremely hard to do well ... you often have to make people program in a restricted 'static' subset of the language, like what PyPy does with the RPython dialect:

http://codespeak.net/pypy/dist/pypy/doc/coding-guide.html#re...

Re:Brace : Dialect of C that looks like Python by ramchip on Monday November 09, 2009 @12:37AM (#930463)
C isn't especially dynamic.
Re:Brace : Dialect of C that looks like Python by sswam on Sunday November 08, 2009 @07:33PM (#930098)
brace is an experimental language, the let(a,1) business it a very primitive approach to type inference, it is simply a macro that translates to typeof(1) a = 1 (and unfortunately thereby depends on a gcc extension). I do hope to add proper type inference in a later version of brace.
Re:Brace : Dialect of C that looks like Python by daeken on Sunday November 08, 2009 @03:57PM (#929798)
Looks like a very cool language (I can't help but love any language with real macros), but it looks more like ML than Python to me. I wonder how this compares to OOC. I think I might have to run them both through some tests and publish the results (aesthetics, speed (although I doubt that'll be an issue), flexiblity, etc).
Re:Brace : Dialect of C that looks like Python by pgbovine on Sunday November 08, 2009 @02:42PM (#929677)
looks cool! what features did the author add beyond straightforward (nice-looking) syntactic transformations from Python-like syntax into C code? in other words, if i stared at Brace code and imagined how to manually translate it into C, what tricky cases are there?

the ability to quickly generate graphics with little code reminds me of Processing: http://processing.org/

Re:Brace : Dialect of C that looks like Python by jcw on Sunday November 08, 2009 @08:49PM (#930206)
I would really like to mess around with this, but it doesn't compile under OS X because of some utility differences (namely readlink and cp).
Re:Brace : Dialect of C that looks like Python by sswam on Monday November 09, 2009 @02:53AM (#930575)
drat! I didn't have an OS X box to test it on. I'll ask one of my friends to fix it for me or let me log in to do so. thx for the heads-up.
Re:Brace : Dialect of C that looks like Python by joe_the_user on Sunday November 08, 2009 @10:51PM (#930344)
Hmm,

I'd like to have a dialect of Python that looks C.

Python is a generally cool and you can get used to meaningful whitespace easily BUT the meaningful white space thing becomes very problematic when you're on an arbitrary system using vi and without tools for dealing with Pythonism. When we had a serious bug that was removed by rewriting whitespace in a way we couldn't even determine by sight, I swore never to use the language again. I did a couple of years of python coding earlier. Kind of like project Mono's unexplained memory leaks.

Re:Brace : Dialect of C that looks like Python by tumult on Monday November 09, 2009 @12:46AM (#930474)
:retab

(in vim)

Re:Brace : Dialect of C that looks like Python by eplawless on Sunday November 08, 2009 @11:10PM (#930371)
You've nailed it; they did it backwards :(
Re:Brace : Dialect of C that looks like Python by james2vegas on Sunday November 08, 2009 @05:29PM (#929920)
First OOC, now this. What is the need to make anything look like the ugly indented mess that is python?
Re:Brace : Dialect of C that looks like Python by sswam on Sunday November 08, 2009 @07:36PM (#930100)
since some people like C's syntax and some people like python's syntax, I hope to support both in future, changing one to the other can be as simple as running a program like "indent" over the code.
Re:Brace : Dialect of C that looks like Python by xal on Monday November 09, 2009 @12:42AM (#930467)
You borrow so much from the Ruby community you should add opinionated design to the list. Adding a second syntax to OOC would really detract from the language a lot.