haumea-lang / spec

The official Haumea specification.
MIT License
0 stars 0 forks source link

No better than JS #8

Open bates64 opened 7 years ago

bates64 commented 7 years ago

At the moment, Haumea has less features than JavaScript. This is bad, because it's primarily what we compile to now.

The real work a compiler does is not code generation, but support for the features that make the source language more powerful than the target language.

This rings true - why write the verbose

set string name to input() + '!'
display("Hello, " + where)

when you could write

let name = input() + '!'
console.log('Hello, ' + name)
bates64 commented 7 years ago

We might want to reconsider why Haumea exists..

Also although the language is "simple and easy to learn and program in.." should it be? I feel like set kek to "lol" isn't easy - it's a little verbose opposed to kek = "lol"

If the language is simple and easy, perhaps it should be "easy to learn" instead, because a simple & easy language doesn't give us (or users!) growing room.

birdoftheday commented 7 years ago

I like let instead of set ... to ..., but I want to keep display instead of switching to console.log.

birdoftheday commented 7 years ago

Maybe you could add something like Ruby's blocks.

bates64 commented 7 years ago

@birdoftheday check the spec! We have blocks.

 if 1 = "kek" do
   display("blox")
   other.command()
 end
birdoftheday commented 7 years ago

bad link?

birdoftheday commented 7 years ago

@nanalan Do you have yield?

bates64 commented 7 years ago

In what way?

bates64 commented 7 years ago

This is what compiles at the moment.

birdoftheday commented 7 years ago

Overall I think the language is too verbose and tries to be different and unique just for the sake of being different and unique.

It's not a bad thing, just something that subconsciously comes from designing something (a language that compiles to JavaScript) where there are hundreds of other things that do the same exact thing. I think you should focus less on having unique features and syntax, and more on having useful features and syntax.

bates64 commented 7 years ago

Totally agree with you there. We'll need @BookOwl's input on this too.

birdoftheday commented 7 years ago

RE Yield:

When a block is attached to a function like so,

to forever
  while 1 = 1 yield
end

then you could do something like this

forever do 
  display 'hi'
end

(just pseudo Haumea)

BookOwl commented 7 years ago

You guys are forgetting that Haumea is not designed to be "real" programing language with amazing features. It was designed to do two things:

  1. To help me get better at Rust by working on a larger project.
  2. To see what a Scratch like text based language would look like and if it would be easier to learn to program in.

It has already done 1, and if it is determined that it would be better for beginners to learn with a language that has more traditional syntax, than 2 has succeed also.

birdoftheday commented 7 years ago

Then examine each for its individual merit.

Is the keyword with really necessary? Is to really that versatile?

Is set and to the best, most readable syntax for the job?

bates64 commented 7 years ago

We might want to reconsider why Haumea exists..

You guys are forgetting that Haumea is not designed to be "real" programing language with amazing features.

...we've done that, been there - designing an "easy to learn" language almost never means that it's easy to program in - it's often much to verbose.

Learning to program is like climbing a mountain - at the bottom there are loads of people to help you up. In the middle, there's almost no one. Why? Lo-and-behold, everyone who got to the top is now running "Learn Python for beginners" classes at the bottom.

We need a universal language that isn't domain specific and isn't specifically designed for a target market other than 'programmers,' imho. We've completed reason no 2 and the answer is no - can we move on and make the language actually good now? 😜

bates64 commented 7 years ago

In my opinion, we should study our favourite languages and take the best from them- leaving the worst behind. That'll make a good language. Probably.

BookOwl commented 7 years ago

We should probably just start over from the ground up.

In my opinion, we should study our favourite languages and take the best from them- leaving the worst behind. That'll make a good language. Probably.

As long as we adapt them to be consistent with the rest of language. That's how Python has gotten to be so popular. It takes features that have been found to be very useful in other languages and adapts them to be Pythonic.

birdoftheday commented 7 years ago

Here's my 2 cents on what you should design the syntax on, in most to least important: