Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Certainly any alternative syntax parser for any language would be?

It would also only take a couple of hundred lines to write a parser for a C compiler that would allow that.



Not any to any. You could't write a thin lispy alternative syntax for C because of some semantic differences. "If" is an expression in Julia and Lisp, and it's a statement in C. Dealing with things like goto statements and preprocessor macros would also require some extra work.

Add all that up, and you're no longer looking at alternative syntax, you're looking at a transpiler.


But this is also simply an alternative Syntax that mirrors Clojure, not actual Clojure semantics.


I think we're talking about things different ways around. I'm talking about doing something like what's in the link: an alternative syntax for Julia that mirrors Clojure but retains Julia's features.

You would be harder-pressed to create an alternative parenthesis syntax for C, because C is so syntactically complex.


While julia does not have full lisp semantics, it is very close. Granted, it's not especially similar to Clojure itself. It's closer to a lisp though than almost any other relatively popular modern language that doesn't use S-expressions.


I'm very sceptical of such claims because I do not believe there is such a thing as “Lisp semantics” and that it is primarily a language of syntax. In particular, Common Lisp has many semantic features such as dynamic variables and the function–value dichotomy that do not exist in, say Scheme, or really any other commonly used programming language. And Scheme, yet again, has many rather esoteric operations, such as continuation capturing, that exists nowhere else as well.

The three most popular Lisps today are C.L., Clojure, and Scheme, and I don't see these three having unified semantics at all and they are often further from each other than they are to many other languages.


There are julia implementations of continuation capturing [1] fwiw. Broadly though, I agree that 'lisp semantics' is a very fuzzy term. I'd claim this family has several strong semantic themes despite their differences. E.g. their approach to meta programming, their approach to dynamism, lexically scoped closures, and the everything-is-a-expression rule. Julia fits all these themes (and others), though it's dynasmism is a bit more restricted than most lispy languages, and it's AST is printed differently, even if it's internally represented and manipulated the same as other lispy languages.

You're probably right though that we wouldn't be tempted to group them together nowadays if it weren't for their syntactic similarities.

[1] https://github.com/MikeInnes/Continuations.jl


Virtually every modern language has lexical closures; dynamic typing is certainly not unique; and not everything is an expression that returns values at all.


That last point is just wrong. Sometimes the return value is `nothing`, but that's still very much a return value.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: