haumea-lang / haumea-rs

Haumea is an experimental language designed to be simple and easy to learn and program in.
MIT License
7 stars 2 forks source link

Comments #6

Closed BookOwl closed 7 years ago

BookOwl commented 7 years ago

This is probably important. 😉 EDIT: After discussion, I've decided to use /* Comment */

BookOwl commented 7 years ago

What should the comment syntax be?

  1. /* C style */
  2. { Pascal style }
  3. # Python-ish style #
  4. <| Something I made up |>
  5. {| Something else I made up |}
  6. <- HTML-ish ->
  7. (| Bananas |)
  8. (: Emojis :)
  9. Indention (files are a superset of MarkDown)
  10. ? Question marks and ??? Multiline ???

@liam4 @nanalan @jonathan50 @TheMonsterFromTheDeep @algmwc5 please tell me which one you guys think is best (and be serious please)

joker314 commented 7 years ago

I am not one of the people listed, but oh well. I'll rank them in order, so my favourite will be at the top, and the one I dislike most will be 8th

  1. 6
  2. 1
  3. 2
  4. 8
  5. 3
  6. 4
  7. 7
  8. 5

5 just seems to be vertically misaligned and thus displeasing to the eye.

ghost commented 7 years ago

I would prefer C style comments as they're used in a good amount of languages and sometimes pseudocode. Line comments (in the form of //) would be nice too instead of only multiline.

TheMonsterFromTheDeep commented 7 years ago

I like both C-style and Python-ish style. I'm honestly actually not sure which one I like better - although I think whichever one you choose should support block comments.

joker314 commented 7 years ago

I like many of the brackets where the opening and closing character is different. Oh, and an interesting feature I would suggest is allow you to escape comment endings. Not sure how useful this would be, but a

< My comment \> continues till here> and then stops

might be cool, not sure though.

I don't like the Python-ish one much because hashtags have a rightward slant that makes my brain think of it as an opening "bracket". If there was a hashtag in ASCII that slants in the opposite direction I'd say that could be a pretty cool comment system.

BookOwl commented 7 years ago

@joker314, I just didn't know your Github account.

Right now I'm deciding between 1 and 6. Thanks for the input guys! :D

TheMonsterFromTheDeep commented 7 years ago

I personally don't really find angle brackets to be that attractive for commenting. However, that may simply be because I'm so used to other symbols for it... :package:

I think however that the best choice for this language is something that clearly marks said comment as descriptive, and I honestly have no idea what the best syntax to do that might be. I think something with quotation marks might work, like <" comment > because that sort of marks it as a note, but then there is the confusion between that and string syntax...

The other symbol I think might work with commenting is the question mark, so maybe something like <? comment > would be good. I like the question mark in comments because it sort of looks distinct from code and it also sort of conveys the notion that it's there to help.

I also agree with io that inline comments would be nice too - I think question marks would also work well for that, e.g.

? This method calculates the factorial of parameter n.
? This is not the most efficient way to do it, but it works for demonstration purposes.
to factorial with (n) do ...
jeandrek commented 7 years ago

Hmmm. I like 2-5.

@TheMonsterFromTheDeep Then you can't name procedures or variables stuff like is_integer?. Oh, Haumea doesn't allow question marks in names anyway lol

ghost commented 7 years ago

@Jonathan50 You can't on quite a few other languages either 📦

TheMonsterFromTheDeep commented 7 years ago

@Jonathan50 Yeah, there are certainly problems with question marks. :P

I think it's honesty pretty difficult to design a perfect comment syntax for this language, because comment syntax needs to be concise and not interfere with other syntax, but in this case it should also be relatively readable. :/

ghost commented 7 years ago

@TheMonsterFromTheDeep Maybe # or even --? Python, Elixir use the former, Lua the latter, and they all are similar to Haumea in style. I'm kinda leaning to them since, now that I think of it, \\ feels too "advanced" for a language of this kind.

jeandrek commented 7 years ago

There's the Smalltalk-style "...".

ghost commented 7 years ago

Shell style #Comments

tjvr commented 7 years ago
  1. Files are a superset of markdown. Executable code is indented; comments are everything else...
towerofnix commented 7 years ago

I don't dislike --.

CosmicWebServices commented 7 years ago

C style

BookOwl commented 7 years ago
  1. Files are a superset of markdown. Executable code is indented; comments are everything else...

That's interesting, I actually have heard of a language like that, but I don't know how many people are going to be writing documents that have Haumea code in it.

tjvr commented 7 years ago

I actually have heard of a language like that

I did shamelessly steal the idea from Eve :)

bates64 commented 7 years ago

I like --, lua-style, or ?, both of which continue until newline. Multi-line comments are needed though.

If I had to pick one of the 6, I'd say JS/Python style.

joker314 commented 7 years ago

Or you could do (for begginer friendliness)

comment 
...
end
CosmicWebServices commented 7 years ago

^^^

towerofnix commented 7 years ago

@joker314 I honestly can't tell if that's sarcastic or not.

BookOwl commented 7 years ago

I really like the question marks so far, but what about for multiline comments?

towerofnix commented 7 years ago
???
  Blah
???
BookOwl commented 7 years ago

That could work.

joker314 commented 7 years ago

Unless somebody writes a comment like WHYY???? which will unfortunately close the comment

towerofnix commented 7 years ago

??? could require a line dedicated to itself.

bates64 commented 7 years ago
? I'm a comment.
blah blah do
  ???
    this is a multiline comment
    really??? yes
  ???
  stuff
end
CosmicWebServices commented 7 years ago

or

***
Comment
***
towerofnix commented 7 years ago

I saw that. :P

bates64 commented 7 years ago

Provided somebody writes syntax definitions for Haumea, the actually character shouldn't matter too much since comments would be highlighted :wink:

I keep on reading "Haumea" as "Haulea"

joker314 commented 7 years ago

In the *** system, you can't posssibly write Terms and Conditions apply*** so it should be fine, and allow you to write comments in between tokens:

while ***this will loop*** x < 5 do

joker314 commented 7 years ago

nanalan, yeah, but what if somebody is using Notepad to write Haumea

towerofnix commented 7 years ago

I guess inline comments are nice..?

? This will loop
while x < 5 do

But I prefer this placement of comments..

joker314 commented 7 years ago

Of course but some people might write long one liners

BookOwl commented 7 years ago

@joker314 THEN THEY ARE NOT WORTHY TO USE HAUMEA!

joker314 commented 7 years ago

eheehe

bates64 commented 7 years ago
some stuff ? hi

? until a newline anywhere could work.

towerofnix commented 7 years ago
while (
  this and ? ..
  that and
  this or even that ? ..
)
BookOwl commented 7 years ago

I really like ? this is a comment for single line comments, and

???
Hi!
???

for multiline comments

bates64 commented 7 years ago

gj with the markdown there :sunglasses: image

towerofnix commented 7 years ago

I suppose I'm not allowed to +1 that, given I brought up the idea. :tada:

bates64 commented 7 years ago

@BookOwl I also like the fact you used the same font that Gwiddle uses (?) for the Haumea logo :shipit:

BookOwl commented 7 years ago

Really? I never knew that.

BookOwl commented 7 years ago

Also, if users REALLY want inline multiline comments, they could do

while ??? This is my condition ??? foo() ??? This is my statement. ??? do
 bar()
end
joker314 commented 7 years ago

Exactly.

BookOwl commented 7 years ago

If anybody has any major objections to question mark comments, speak up now.

CosmicWebServices commented 7 years ago

My idea works too

while ***This is my condition*** foo() *** This is my statement. *** do
   bar()
end
joker314 commented 7 years ago

Hey, why not have two comment thingies

CosmicWebServices commented 7 years ago

I think I like *** better than ??? but is just my opinion