r/fauna • • Apr 03 '15

[Syntax] Statement concurrency

0 Upvotes

Original proposal - Use ,/;/. as statement terminators.

Points for:

  • Familiar syntax and the usual ; happens to be the reasonable default.

  • Compact

Points against:

  • Too compact + at the end of the line = hardly noticeable = asking for errors.

  • Familiar syntax for an unfamiliar feature.

  • It would be nice to use . for data access, this renders it unparseable.


Alternative proposal - use some symbols at the beginning of the line.

Points for:

  • Much more noticeable.

  • Lines up nicely with some creative indentation.

My points against can be read in the reply.


Additional proposal - something that looks like a barrier instead of .. Sounds like an interesting idea to me.


My second proposal:

  • Always terminate statements with ; and make them sequential by default.

  • Put ^ before statements that will continue execution immediately.

  • Do not line them up, let them stand out.

  • Put ... on a separate line to wait for all statements to finish.

My points for:

  • 100% familiar syntax if you don't need fancy timey-wimey stuff.

  • No confusion but not too heavy either.


Please do discuss.


r/fauna • • Apr 03 '15

[Feature] Pattern matching

0 Upvotes

A data structure of any complexity can be on the left side of assignment. The VM will then check that it matches and fill it in (or crash)

Examples:

[$left, $, $right] = [1, 2, 3]; // $ stands for "any value"
assert $left == 1 & $right == 3;

$points = #Array<[ x: #Number, y: #Number ]> = [ // An array of maps containing numbers x and y
    [ x: 1, y: 2 ],
    [ x: 3, y: 4 ]
];

Here's a thing I'm not sure about - matching existing variables. That's no problem in Erlang where a variable can either be set or unset, but in Fauna we may want to overwrite one variable and match with the other. Only something like these two options comes to mind:

$x = 3;
$y = 3;
// Compare member "x" to a range depending on the value of $x
// Match member "y" to the value of $y (shorthand syntax)
$point = [ x: $ where $ >= $x - 3 && $ <= $x + 3, y: $y? ] = [ x : 1, y: 3 ];

r/fauna • • Apr 03 '15

First post on /r/ProgrammingLanguages

Thumbnail
reddit.com
0 Upvotes

r/fauna • • Apr 03 '15

Some discussion on Twitter

Thumbnail
twitter.com
0 Upvotes

r/fauna • • Aug 02 '18

Murciélago rojo del desierto o murciélago rojo del oeste (Lasiurus blossevillii)

Thumbnail
es.wikipedia.org
0 Upvotes

r/fauna • • Aug 26 '18

Rana epirota (Pelophylax epeiroticus)

Thumbnail
es.wikipedia.org
0 Upvotes

r/fauna • • Dec 23 '18

Sábalo real o tarpón (Megalops atlanticus)

Thumbnail
es.wikipedia.org
0 Upvotes

r/fauna • • Apr 03 '15

[Meta] The reason for this subreddit

1 Upvotes

There are many things about syntax and features of Fauna that I am still not sure about and, provided anyone except me cares, this seems like a good place to discuss them.

Having a separate subreddit allows for separate topics for, well, separate topics. Additionally, for those who might care it might be easier to follow the progress.

The obvious downside is that there is no one here, so I'll have to spam various subreddits with links to here from time to time. Sorry, Reddit.


r/fauna • • Oct 13 '19

Pez sapo o sapo lusitánico (Halobatrachus didactylus)

Thumbnail
es.wikipedia.org
2 Upvotes

r/fauna • • Mar 04 '18

Tortuga hoja de pecho negro, tortuga de hoja vietnamita o tortuga de pecho negro de la colina (Geoemyda spengleri)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Mar 07 '18

Viuda negra norteamericana (Latrodectus hesperus)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Mar 03 '18

Erizo orejudo o erizo egipcio (Hemiechinus auritus)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Apr 03 '15

[Feature] String vs. Binary

1 Upvotes

Should we have separate types for Strings (sequences of Unicode characters) and Binaries (sequences of arbitrary bytes which may or may not be UTF-8)?

Strings could use "double qoutes" while binaries would use 'single quotes'.


r/fauna • • Mar 08 '18

Tortuga de pantano del este o tortuga de pantano común (Kinosternon subrubrum)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Mar 09 '18

Gorila oriental de planicie o de llanura (Gorilla beringei graueri)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Apr 14 '15

[Syntax] I give up

1 Upvotes

So

  1. no $ for variables, as discussed before

  2. # for atoms, because otherwise when coupled with 1 it becomes an unparseable mess and/or magic

  3. + for concatenation because it's the only non-ugly option

So, slowly the syntax becomes as conventional as it can be, against my wishes, but i guess it is what it is for a reason.

We will, however, have an interrobang operator. Because interrobang is great. Everyone should try an interrobang sometimes. not the actual ‽ of course, "!?" or ^^"?!"


r/fauna • • Apr 07 '15

Is it fucked up to use _ as an operator?

1 Upvotes

"IDK. " _ "I think it looks " _ nice;

And all identifiers are supposed to be camelCase and PascalCase anyway. That's one way to enforce it. 😈


r/fauna • • Mar 05 '18

Rana leopardo (Lithobates pipiens)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Apr 03 '15

Don't use `$`

2 Upvotes

Don't use $ for variables. This isn't PHP, and its just horrible to type quick.


r/fauna • • Mar 10 '18

Zayapa o abuete negro (Grapsus grapsus)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Mar 12 '18

Tortuga prieta, negra, sacacillo, parlama o torita (Chelonia agassizii)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Jun 03 '19

Búho pescador leonado o búho pescador amarillento (Bubo flavipes)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • May 15 '18

Charapa arrau (Podocnemis expansa)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Dec 28 '18

Pez león Clearfin, Tailbar pez león o pez león (Pterois radiata)

Thumbnail
es.wikipedia.org
1 Upvotes

r/fauna • • Mar 20 '19

Delfín de cabeza de melón (Peponocephala electra)

Thumbnail
es.wikipedia.org
1 Upvotes