News for hackers. Stuff that matters.
Re:The Crack Programming Language by dietrichepp on Monday November 26, 2012 @01:50AM (#4830956)
This page doesn't sell it to me. Maybe it's a great language, who knows?

1. With Go, I understand the point. It makes advances in terms of how easy it is to write concurrent programs, without completely ditching the traditional imperative model.

2. Rust is a different take on the same point. We want concurrency and safety. Rust's difference from Go is that it is more safe, and makes it easier to give latency guarantees.

But I don't get what's "hard" about, say, Go, that Crack would make things easier for me. What does Crack offer that Go doesn't? Or Python? Why would I want to use Crack at all?

(I get that they want to say it's "addictive" so they'll call it "crack", but it's a terrible name. I worked for a company that wanted a product to go viral so they code-named it "Marburg", after a biological weapon. Maybe I should name my next product "Enola Gay" because it will level the competition?)

Re:The Crack Programming Language by wbhart on Monday November 26, 2012 @09:06AM (#4831936)
Technically, work on Crack became public before work on Go did. So you should be asking what Go provides that Crack doesn't. Technically.
Re:The Crack Programming Language by rjzzleep on Monday November 26, 2012 @12:30PM (#4832893)
and rust,

but yeah, maybe its the name

Re:The Crack Programming Language by mitchi on Monday November 26, 2012 @02:36AM (#4831039)

   import crack.io cout;
    x := 'test';
    cout `This is a $x\n`;  # prints "this is a test" to standard output.
Really weird strings... I don't even know how to type this character with my keyboard layout. Nice job for this language. It has a lot of things for so few versions. I couldn't build something like this. But who would use this? D is 10 times better and mature and almost no one uses it.
Re:The Crack Programming Language by peteretep on Monday November 26, 2012 @02:47AM (#4831074)
You don't know where to find the backtick on your keyboard?!
Re:The Crack Programming Language by gosub on Monday November 26, 2012 @02:51AM (#4831085)
I''l give you an example: http://en.wikipedia.org/wiki/File:KB_Italian.svg

edit: a couple of funny things for italian keyboards, if you are a programmer or use linux/unix: there is no backtick, there is no tilde, '/' is shift-7, '/' and '?' are on different keys, '{}' are on altgr-shift-è.

Re:The Crack Programming Language by threedaymonk on Monday November 26, 2012 @03:37AM (#4831169)
That keyboard layout doesn't seem particularly well-suited to programming. Then again, it doesn't seem particularly well-suited to typing Italian, either, though I now understand why Italians often write E' instead of È.
Re:The Crack Programming Language by anonymous on Monday November 26, 2012 @08:13AM (#4831772)
And this, ladies and gentlemen, is why all programmers, sysadmins and so on use a US keyboard layout.
Re:The Crack Programming Language by kokey on Monday November 26, 2012 @05:27AM (#4831409)
It might go a long way to explaining why I don't come across many Italian Unix sysadmins, and the few I have come across coded their system scripts in php.
Re:The Crack Programming Language by fceccon on Monday November 26, 2012 @06:29AM (#4831546)
I'm Italian and nearly everyone I know (who's a programmer) uses an US layout.
Re:The Crack Programming Language by dietrichepp on Monday November 26, 2012 @02:50AM (#4831078)
I'm guessing you live in the US...
Re:The Crack Programming Language by peteretep on Monday November 26, 2012 @04:08AM (#4831226)
No. But I /do/ occasionally use bash, or call out to the shell from scripting languages...
Re:The Crack Programming Language by mguillemot on Monday November 26, 2012 @04:38AM (#4831294)
BUT=$(echo So do I...)
Re:The Crack Programming Language by yarrel on Monday November 26, 2012 @04:42AM (#4831302)
The scripting language is Perl, apparently.
Re:The Crack Programming Language by fuzzix on Monday November 26, 2012 @06:21AM (#4831535)
Does Perl make us of a lot of characters you can't find on your keyboard? Sure, you can use backticks shell style, but you'll probably have better luck with IPC::Open3.

Perl's strings look pretty much the same as everyone else's strings.

Re:The Crack Programming Language by jacobolus on Monday November 26, 2012 @01:29AM (#4830908)
"Crack aims to provide the ease of development of a scripting language with the performance of a compiled language."

Where’s the speed comparison? Where’s a substantial enough code sample to show that development is “easy”?

Re:The Crack Programming Language by dietrichepp on Monday November 26, 2012 @01:37AM (#4830929)
They probably assume that as long as it's not too burdened with runtime dispatch, then LLVM will take care of the speed. And they'd be right.

(Popular JavaScript implementations manage high speed even with runtime dispatch. The optimizations make heavy use of static analysis, but this is difficult to do.)

Re:The Crack Programming Language by seanmcdirmid on Monday November 26, 2012 @01:45AM (#4830947)
Why do you think run time dispatch is that slow? With static typing you can setup an efficient vtable, while even with just dynamic typing there is a lot of cachingq you can do to reduce call overhead. Static analysis helps for some inlining, but the gain isn't more than a few percent.

Garbage collection and run time safety checks probably cost more than call indirection.

Re:The Crack Programming Language by dietrichepp on Monday November 26, 2012 @01:55AM (#4830971)
Call indirection prevents inlining. It's not about comparing indirect calls versus direct calls, it's about comparing indirect calls against no function call at all.

For example, imagine a function that multiplies two matrices. If the matrices are statically typed, the resulting function would only need to allocate the result. If the matrices aren't statically typed, you need to dispatch on the type of each element in each matrix. That will take much longer.

Yes, there are ways around this in languages with dynamic dispatch. However, my point is that LLVM won't do it for you.

Re:The Crack Programming Language by blitzprog on Monday November 26, 2012 @04:16AM (#4831251)
"Crack aims to provide the ease of development of a scripting language with the performance of a compiled language."

Have you looked at the Flua project yet? It's pretty much this and much more. http://flua-lang.org/

Re:The Crack Programming Language by wbhart on Monday November 26, 2012 @08:45AM (#4831858)
You are joking aren't you? There's not a line of documentation on the Flua webpage. The Windows download doesn't open on my Windows machine and I need a GUI to run it on Linux (which my linux box doesn't support). It also claims to be as fast as C, but a cursory examination of the source suggests it is entirely written in Python and Flua!
Re:The Crack Programming Language by blitzprog on Monday November 26, 2012 @10:12AM (#4832239)
That's because there is no online version of the documentation right now. It's only available in the editor, it's an Alpha after all. Just because the compiler is written in Python it does not mean the Flua programs are executed in Python. In fact they can be executed in multiple environments and C++ is the one which is currently being developed, hence the programs _are_ fast. How come the Windows download doesn't work for you? It works on vanilla Windows, that's really strange.

Just stay on a constructive level. It would have been nice if you submitted a bug report on GitHub about the error you got on your Windows machine.

Re:The Crack Programming Language by antihero on Monday November 26, 2012 @07:20PM (#4834793)
Locking people into needing a specific editor just to get the documentation is a bad move.
Re:The Crack Programming Language by blitzprog on Tuesday November 27, 2012 @03:33AM (#4836234)
Yeah, sorry - I just couldn't find any time to write an online version. Will do it as soon as possible.
Re:The Crack Programming Language by pike on Monday November 26, 2012 @02:11AM (#4830994)
Re:The Crack Programming Language by octo_t on Monday November 26, 2012 @08:21AM (#4831791)
Start reading the spec, get to "For complex types (which we'll discuss later), a null pointer is used" under default initialization

wonderful.

Re:The Crack Programming Language by linker3000 on Monday November 26, 2012 @05:30AM (#4831416)
Once could make all sorts of comments about the fact that this article currently appears immediately above the one on 'hacking my vagina' - but that would be too easy.
Re:The Crack Programming Language by laumars on Monday November 26, 2012 @08:40AM (#4831848)
Joking aside, 'Crack' is a questionable name for a programming language.
Re:The Crack Programming Language by perfunctory on Monday November 26, 2012 @03:08AM (#4831123)
I am inclined to dismiss the language for this:

  i++
Re:The Crack Programming Language by wbhart on Monday November 26, 2012 @08:50AM (#4831881)
I would have once disagreed with you being a C programmer. However, nowadays there is a tendency to providing functional features, including for example if..else expressions. But if you make i++ an expression, you end up with ambiguities if i++ ends up being the last line of an if..else branch, and say s = "hello" being the last line of the other branch. In a statically compiled language, the compiler has no choice but to interpret both as expressions and complain about the types of the two if..else branch expressions not matching. However, the programmer may have intended these expressions for their side effects only, not their values. Perfectly good code needs to be rewritten to work around the type checker. How fiddly.
Re:The Crack Programming Language by derleth on Monday November 26, 2012 @03:37AM (#4831170)
Why?
Re:The Crack Programming Language by mguillemot on Monday November 26, 2012 @04:40AM (#4831297)
I'd venture into guessing that the parent reason is that ++ and -- operators tend to make easy to bury side-effects where they're not obvious, like in the provided code sample:

__raw[args[i++]] = 1;

(C programmers would disagree about this, of course :) )