You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current iteration of Juvix's syntax resembles an ALGOL derivative with inspirations from AGDA. in an ML or ALGOL style syntax, , is often reserved. For ML's , is often reserved so it may be used in literal syntax
ML Syntax
taichi@Gensokyo:~ % rlwrap smlnj
Standard ML of New Jersey (64-bit) v110.99.3 [built: Sat Jul 3012:02:292022]
- [1,2,3];;
val it = [1,2,3] : int list
taichi@Gensokyo:~ % ghci
GHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help
ghci> :t [1,2,3]
[1,2,3] :: Num a => [a]
Idris> take 10 [1..]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] : List Integer
Idris> [2,3]
[2, 3] : List Integer
For OCaml it is used for tuple syntax, however ; happens to be non-clashing enough to use it for list literal syntax.
With that said, there are some families that do not reserve ,. These are typically the forth family and the hoon family. hoon uses , as a normal rune, and as for factor, I can have symbols like
IN: scratchpad 1 20 [a,b) interval>points
--- Data stack:
{ 1 t }
{ 20 f }
This is because the syntax's are truly minimal, and thus no tension is had, as they aren't expected by convention to be reserved by the language creators.
This has a few issues with people coming from other lisps, however that is not relevant in this current case.
Compounding Factors
I believe in issue #1495 the issue makes itself present, with patch #1525 relieving the tension. However, if , was reserved no special patch would be needed.
Further I would like to argue that one should be conservative on what symbols are not reserved, as in the future , and other key symbols may be needed to disambiguate syntax. The current iteration of Juvix may further down the line want record literal syntax, hash table syntax, etc. Without , reserved, then one may have to rely on ; which may be overloaded in such a way to cause ambiguity issues. Thus I think it is prudent to reserve symbols like ,, @, ~ as special prematurely to later be spent when the opportunity arises (or give back if no such opportunity is found).
Conclusion
Make , reserved, have it be used for list literal syntax. Further, push the concept and try to think of record literal syntax in the future with the use of ,. ; may be too overloaded by that point to be useful for record syntax, and a reserved symbol ought to be used.
The text was updated successfully, but these errors were encountered:
The current iteration of Juvix's syntax resembles an
ALGOL
derivative with inspirations fromAGDA
. in anML
orALGOL
style syntax,,
is often reserved. For ML's,
is often reserved so it may be used in literal syntaxML Syntax
For
OCaml
it is used for tuple syntax, however;
happens to be non-clashing enough to use it for list literal syntax.The odd ML out is
Agda
which has no literal syntax.ALGOL syntax
In the
ALGOL
family,,
use is ubiquitous, with,
coming in for function separation, and even for array literalsOther Families
With that said, there are some families that do not reserve
,
. These are typically theforth
family and thehoon
family.hoon
uses,
as a normal rune, and as for factor, I can have symbols likebecause words are separated by spaces. The [a,b) word can be found here.
This is because the syntax's are truly minimal, and thus no tension is had, as they aren't expected by convention to be reserved by the language creators.
The
Lisp
family often reserves,
in the pre defined reader macro set as they serve as a useful function in the quasi quotation reader macro. However even with that said, a language like Clojure has explicitly made,
whitespace in order to make people familiar with other lanugages on the JVM feel more at homeThis has a few issues with people coming from other lisps, however that is not relevant in this current case.
Compounding Factors
I believe in issue #1495 the issue makes itself present, with patch #1525 relieving the tension. However, if
,
was reserved no special patch would be needed.Further I would like to argue that one should be conservative on what symbols are not reserved, as in the future
,
and other key symbols may be needed to disambiguate syntax. The current iteration of Juvix may further down the line wantrecord
literal syntax, hash table syntax, etc. Without,
reserved, then one may have to rely on;
which may be overloaded in such a way to cause ambiguity issues. Thus I think it is prudent to reserve symbols like,
,@
,~
as special prematurely to later be spent when the opportunity arises (or give back if no such opportunity is found).Conclusion
Make
,
reserved, have it be used for list literal syntax. Further, push the concept and try to think of record literal syntax in the future with the use of,
.;
may be too overloaded by that point to be useful for record syntax, and a reserved symbol ought to be used.The text was updated successfully, but these errors were encountered: