Re: Crystal

2013-02-28 Thread pjmlp

On Thursday, 28 February 2013 at 08:22:45 UTC, thedeemon wrote:
On Sunday, 17 February 2013 at 06:28:09 UTC, Ary Borenszweig 
wrote:
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.


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


I think everyone who wants to create languages should first 
familiarize himself with ML family of languages and especially 
OCaml. It's got global type inference done right, you can write 
big programs never specifying types of arguments of functions, 
they all got inferred, and not just to first occurrence but to 
most general (polymorphic) form. The compiler is incredibly 
fast and generated code is pretty fast too (approximately as 
fast as Java).


Things to learn: Damas-Hindley-Milner, structural typing, row 
polymorphism.


So your questions are already answered ages ago: yes, it is 
possible to have static typing with conciseness of dynamic 
languages, speed of static languages and a fast compiler which 
inferences types.


Also, knowing OCaml will make your life much easier as a 
compiler developer. Writing compilers is much much easier and 
more convenient in ML than in Ruby, I know it from first-hand 
experience, I did both in the past.


My university degree had a strong focus in programming languages. 
We were not allowed to use ML, Lisp or Prolog for compiler design 
classes because it would make the project too easy. :)


--
Paulo


Re: A look at the D programming language by Ferdynand Górski

2013-01-15 Thread pjmlp

On Tuesday, 15 January 2013 at 20:07:49 UTC, Walter Bright wrote:

On 1/15/2013 8:37 AM, Paulo Pinto wrote:
Then I started working in multi-site projects with developers 
from all types of
backgrounds, and understood the value of a consistent project 
code formatting.


I agree with the value as you say, but as I posted previously I 
think consistent formatting is the job of a source code 
formatter, not the language.


Sure, I was speaking in general.

Even better, have some kind of indent tool run as part of the
check-in process.