Jump to page: 1 25  
Page
Thread overview
Crystal
Feb 17, 2013
Ary Borenszweig
Feb 17, 2013
Paulo Pinto
Feb 17, 2013
Jacob Carlborg
Feb 17, 2013
Paulo Pinto
Feb 17, 2013
Jacob Carlborg
Feb 17, 2013
Ary Borenszweig
Feb 17, 2013
Paulo Pinto
Feb 17, 2013
Denis Shelomovskij
Feb 17, 2013
Ary Borenszweig
Feb 17, 2013
bearophile
Feb 17, 2013
Russel Winder
Feb 17, 2013
Jacob Carlborg
Feb 17, 2013
Jacob Carlborg
Feb 17, 2013
Ary Borenszweig
Feb 17, 2013
Jacob Carlborg
Feb 17, 2013
Ary Borenszweig
Feb 17, 2013
Jacob Carlborg
Feb 18, 2013
Ary Borenszweig
Feb 18, 2013
Jacob Carlborg
Feb 17, 2013
JN
Feb 17, 2013
Jacob Carlborg
Feb 19, 2013
Walter Bright
Feb 25, 2013
Ary Borenszweig
Feb 27, 2013
Walter Bright
Feb 20, 2013
Knud Soerensen
Feb 20, 2013
Ary Borenszweig
Feb 20, 2013
Jozsef Sarosi
Feb 21, 2013
Jesse Phillips
Feb 21, 2013
bearophile
Feb 21, 2013
Jacob Carlborg
Feb 21, 2013
Jesse Phillips
Feb 21, 2013
Jesse Phillips
Feb 21, 2013
bearophile
Feb 27, 2013
Jordan Miner
Feb 27, 2013
David Nadlinger
Feb 28, 2013
thedeemon
Feb 28, 2013
pjmlp
Mar 20, 2013
Simen Kjaeraas
Mar 20, 2013
Russel Winder
Mar 20, 2013
Graham Fawcett
February 17, 2013
Hello everyone :-)

I follow this newsgroup from time to time. I like D templates. I like the auto keyword. I like auto in templates. I love efficiency and expressiveness.

I believe in smart compilers.

(you might remember me: I'm the author of Descent)

I *really* like D, because it cares about one thing I care about: *performance*. Let's save this world's energy. Let's make a better world. Let's make users' life more enjoyable. Let's be happy :-)

But... do we really have to specify const pure safe nothrow and whatnot? Can't the compiler be smarter? I'm sure there must be a better way. Most new programming languages look like older ones. Newness comes slowly...

One time I asked in this newsgroup if it was possible to have an "auto" keyword for function/method arguments. And... why not make all functions/methods be templates on the type of its arguments?

I think nobody liked this idea. I said "Ruby is like this: you never specify types in method definitions".

"But Ruby is not efficient". "Ruby is a dynamic language". "D is compiled, so it's faster". "Don't make the mistake of comparing a dynamic language with a static/systems programming language". This were some of the answers I got.

I started thinking about this idea: a compiled language that looked like a dynamic language. Is it possible?

Today, I'd like you to take a look at what me and my friend Juan have been working on for the last half month or so. It's a new programming language which aims to be efficient, have similar syntax to Ruby, and where you never have to specify types of variables and arguments.

https://github.com/manastech/crystal/wiki/Introduction

I'd also like to ask you:

1. Do you know whether a similar language exists?
2. Do you think it's feasible? Right now we are getting rather high compilation times (say, a minute) if we use lots of generic classes on medium-large programs. We are still trying to think of the best way to improve compilation times while at the same time taking off programmer's burden.

(The compiler is written in Ruby, which is a bit slow, so that might be one reason it is a bit slow on medium-large programs... imagine Ruby might be 10 to 100 times slower than C, so that minute might be reduced to less than a second... we are currently working on bootstrapping the compiler... but if compilation is on an exponential order, well, you know... ... and the compiler is written in Ruby because it'll later (now?) be easier to port to Crystal, which has a very similar syntax)

I ask about feasibility, but right now you can use this language for small to medium programs (except the standard library is still incomplete).

The goal of this programming language it so be as efficient as possible, but probably it won't be as efficient as C in the general case. But... who knows?

We are also thinking about incorporating concurrency features, like the ones present in Erlang and Go.

In short: utopy =o)

I hope at least someone likes this project...

(I hope at least you, Jacob Carlborg, Ruby lover, find it interesting... or maybe you, bearophile?)

Thanks for your comments,
Ary

P.S.: bin/crystal -e 'a = 0; 10.times { |i| a += i }; puts a' -O3 -ll
February 17, 2013
Am 17.02.2013 07:28, schrieb Ary Borenszweig:
> Hello everyone :-)
>
> I follow this newsgroup from time to time. I like D templates. I like
> the auto keyword. I like auto in templates. I love efficiency and
> expressiveness.
>
> I believe in smart compilers.
>
> (you might remember me: I'm the author of Descent)
>
> I *really* like D, because it cares about one thing I care about:
> *performance*. Let's save this world's energy. Let's make a better
> world. Let's make users' life more enjoyable. Let's be happy :-)
>
> But... do we really have to specify const pure safe nothrow and whatnot?
> Can't the compiler be smarter? I'm sure there must be a better way. Most
> new programming languages look like older ones. Newness comes slowly...
>
> One time I asked in this newsgroup if it was possible to have an "auto"
> keyword for function/method arguments. And... why not make all
> functions/methods be templates on the type of its arguments?
>
> I think nobody liked this idea. I said "Ruby is like this: you never
> specify types in method definitions".
>
> "But Ruby is not efficient". "Ruby is a dynamic language". "D is
> compiled, so it's faster". "Don't make the mistake of comparing a
> dynamic language with a static/systems programming language". This were
> some of the answers I got.
>
> I started thinking about this idea: a compiled language that looked like
> a dynamic language. Is it possible?
>
> Today, I'd like you to take a look at what me and my friend Juan have
> been working on for the last half month or so. It's a new programming
> language which aims to be efficient, have similar syntax to Ruby, and
> where you never have to specify types of variables and arguments.
>
> https://github.com/manastech/crystal/wiki/Introduction
>
> I'd also like to ask you:
>
> 1. Do you know whether a similar language exists?
> 2. Do you think it's feasible? Right now we are getting rather high
> compilation times (say, a minute) if we use lots of generic classes on
> medium-large programs. We are still trying to think of the best way to
> improve compilation times while at the same time taking off programmer's
> burden.
>
> (The compiler is written in Ruby, which is a bit slow, so that might be
> one reason it is a bit slow on medium-large programs... imagine Ruby
> might be 10 to 100 times slower than C, so that minute might be reduced
> to less than a second... we are currently working on bootstrapping the
> compiler... but if compilation is on an exponential order, well, you
> know... ... and the compiler is written in Ruby because it'll later
> (now?) be easier to port to Crystal, which has a very similar syntax)
>
> I ask about feasibility, but right now you can use this language for
> small to medium programs (except the standard library is still incomplete).
>
> The goal of this programming language it so be as efficient as possible,
> but probably it won't be as efficient as C in the general case. But...
> who knows?
>
> We are also thinking about incorporating concurrency features, like the
> ones present in Erlang and Go.
>
> In short: utopy =o)
>
> I hope at least someone likes this project...
>
> (I hope at least you, Jacob Carlborg, Ruby lover, find it interesting...
> or maybe you, bearophile?)
>
> Thanks for your comments,
> Ary
>
> P.S.: bin/crystal -e 'a = 0; 10.times { |i| a += i }; puts a' -O3 -ll


Nice work.

Have you looked into Ruby Motion or Mirah as well?

--
Paulo
February 17, 2013
17.02.2013 10:28, Ary Borenszweig пишет:
> Hello everyone :-)
>
> ...
>
> (you might remember me: I'm the author of Descent)

A Hero is here! Let me kowtow to you, a Descent Creator!

> ... Let's save this world's energy.

It's pleasantly to see this point of view at efficiency.

> But... do we really have to specify const pure safe nothrow and whatnot?
> Can't the compiler be smarter? I'm sure there must be a better way. Most
> new programming languages look like older ones. Newness comes slowly...
>
> One time I asked in this newsgroup if it was possible to have an "auto"
> keyword for function/method arguments. And... why not make all
> functions/methods be templates on the type of its arguments?
>
> I think nobody liked this idea. I said "Ruby is like this: you never
> specify types in method definitions".
>
> "But Ruby is not efficient". "Ruby is a dynamic language". "D is
> compiled, so it's faster". "Don't make the mistake of comparing a
> dynamic language with a static/systems programming language". This were
> some of the answers I got.
>
> I started thinking about this idea: a compiled language that looked like
> a dynamic language. Is it possible?

Looks like it is, by what is the reason?

I'd like to specify function attributes explicitly because I do want to get a compilation error when I e.g. use non-safe stuff in safe function instead of a just compiler silently changing the function (and all functions which use it) to unsafe. I also don't use type inference everywhere because sometimes I do want to see exact types (yes, IDE problem) and sometimes I just don't want a type to be accidentally changed because of some function signature change as in the worst case the code will still compile but will work incorrect.

Now about argument types. I do not understand the purpose of dynamic typing at all and consider such languages too dangerous to use in real projects. You proposal is a bit better as it will give CT errors (instead of RT in dynamic typing case) but still bad as the code can accidentally compile and work incorrect. Also this looks as a step back as your proposal is like making from a function something like C's preprocessor macro. And I remember how somebody defended C's macros and told "you can do it with macro", then he gave his code where he made a fatal mistake by passing two parameters to a macro in a wrong order. And that code accidentally compiled. Same thing can happen with every high templated code where it is hard to predict every possible argument combination.

I also have seen a lot of mistakes of any types in D templated code so I consider such code almost as dangerous as pointer arithmetic and you proposal to make everything a template looks as insane.

> ...
>
> Thanks for your comments,
> Ary
>
> P.S.: bin/crystal -e 'a = 0; 10.times { |i| a += i }; puts a' -O3 -ll

Sorry for such cruel comment, I it is just my opinion.

-- 
Денис В. Шеломовский
Denis V. Shelomovskij
February 17, 2013
Ary Borenszweig:

> I started thinking about this idea: a compiled language that looked like a dynamic language. Is it possible?

Of course it's possible, I given my help in the development of ShedSkin:
http://code.google.com/p/shedskin/

Its compilation times are significant and they keep growing quickly as the amount of compiled code grows.

Bye,
bearophile
February 17, 2013
Why is this thread on the announce mailing list instead of the discussion list?

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


February 17, 2013
On 2013-02-17 08:46, Paulo Pinto wrote:

> Have you looked into Ruby Motion or Mirah as well?

Or MacRuby. It's free (as in free beer) and open source, not something that Ruby Motion is.

-- 
/Jacob Carlborg
February 17, 2013
On 2013-02-17 10:52, Russel Winder wrote:
> Why is this thread on the announce mailing list instead of the
> discussion list?
>

Because he announces a new language ?

-- 
/Jacob Carlborg
February 17, 2013
On 2013-02-17 07:28, Ary Borenszweig wrote:
> Hello everyone :-)
>
> I follow this newsgroup from time to time. I like D templates. I like
> the auto keyword. I like auto in templates. I love efficiency and
> expressiveness.
>
> I believe in smart compilers.
>
> (you might remember me: I'm the author of Descent)
>
> I *really* like D, because it cares about one thing I care about:
> *performance*. Let's save this world's energy. Let's make a better
> world. Let's make users' life more enjoyable. Let's be happy :-)
>
> But... do we really have to specify const pure safe nothrow and whatnot?
> Can't the compiler be smarter? I'm sure there must be a better way. Most
> new programming languages look like older ones. Newness comes slowly...
>
> One time I asked in this newsgroup if it was possible to have an "auto"
> keyword for function/method arguments. And... why not make all
> functions/methods be templates on the type of its arguments?
>
> I think nobody liked this idea. I said "Ruby is like this: you never
> specify types in method definitions".
>
> "But Ruby is not efficient". "Ruby is a dynamic language". "D is
> compiled, so it's faster". "Don't make the mistake of comparing a
> dynamic language with a static/systems programming language". This were
> some of the answers I got.
>
> I started thinking about this idea: a compiled language that looked like
> a dynamic language. Is it possible?
>
> Today, I'd like you to take a look at what me and my friend Juan have
> been working on for the last half month or so. It's a new programming
> language which aims to be efficient, have similar syntax to Ruby, and
> where you never have to specify types of variables and arguments.
>
> https://github.com/manastech/crystal/wiki/Introduction

In general I like it.

> I'd also like to ask you:
>
> 1. Do you know whether a similar language exists?

Except from what others already have mentioned someone created a language with a Python like syntax written in D. But I think that had explicit types.

> 2. Do you think it's feasible? Right now we are getting rather high
> compilation times (say, a minute) if we use lots of generic classes on
> medium-large programs. We are still trying to think of the best way to
> improve compilation times while at the same time taking off programmer's
> burden.
>
> (The compiler is written in Ruby, which is a bit slow, so that might be
> one reason it is a bit slow on medium-large programs... imagine Ruby
> might be 10 to 100 times slower than C, so that minute might be reduced
> to less than a second... we are currently working on bootstrapping the
> compiler... but if compilation is on an exponential order, well, you
> know... ... and the compiler is written in Ruby because it'll later
> (now?) be easier to port to Crystal, which has a very similar syntax)

You can try and precompiled it with MacRuby and see if you get different timings.

> I ask about feasibility, but right now you can use this language for
> small to medium programs (except the standard library is still incomplete).
>
> The goal of this programming language it so be as efficient as possible,
> but probably it won't be as efficient as C in the general case. But...
> who knows?
>
> We are also thinking about incorporating concurrency features, like the
> ones present in Erlang and Go.
>
> In short: utopy =o)
>
> I hope at least someone likes this project...
>
> (I hope at least you, Jacob Carlborg, Ruby lover, find it interesting...
> or maybe you, bearophile?)

I find it very interesting. But actually I'm going to agree with Denis, mostly. If I was going to use Crystal I would probably use a lot more static typing than it's probably made for.

I quite often miss static typing in Ruby. Often there are functions that are supposed to only work with a given type, I don't see why I shouldn't explicitly write that type out then.

A couple of questions:

* Executable code at class level, is that supported? If that's the case, when is it run? Example:

class Foo
  puts "asd"
end

* With a statically typed languages you quite soon get the need for interfaces, abstract classes and similar. How is this handled?

* Is Ruby code supposed to be able to run of out the box in Crystal? That is can I take arbitrary Ruby code and compile it with Crystal and expect it to work. If that's the case, what's currently supported and what's not supported?

-- 
/Jacob Carlborg
February 17, 2013
Am 17.02.2013 12:57, schrieb Jacob Carlborg:
> On 2013-02-17 08:46, Paulo Pinto wrote:
>
>> Have you looked into Ruby Motion or Mirah as well?
>
> Or MacRuby. It's free (as in free beer) and open source, not something
> that Ruby Motion is.
>

My problem with MacRuby and Ruby Motion is they are tied to Mac OS X.

Crystal's usage of LLVM is actually quite positive in that regard.

--
Paulo
February 17, 2013
On 2013-02-17 14:21, Paulo Pinto wrote:

> My problem with MacRuby and Ruby Motion is they are tied to Mac OS X.

Yeah, I agree. But developing for iOS is pretty tied to Mac OS X anyway.

-- 
/Jacob Carlborg
« First   ‹ Prev
1 2 3 4 5