This might seem strange, but if there's one thing from Common Lisp that should receive wider adoption in other languages, it's hyphenated names. They are so much more readable than anything else (well, C with underscores comes close).
I've been playing around with creating a toy language which treats '-' as a name for a function. It means there always needs to be white space around a - (the syntax of the language isn't like LISP), but that increases readability at the cost of two extra key presses.
This would be an easy text-transformation that you could do in vim. Upon opening the file, translate all dashes without spaces "foo-bar" to add spaces "foo - bar". Then convert all underscores to dashes. "foo_bar" to "foo-bar". On save, invert the process.
You'd have to actually run the language's parser in order to do the transformation to avoid changing strings, and even then it'd only work if the parser output kept track of the original line and character so that you could know where to make the change.
This sort of text-transformation is something I've long wished my text editor did. At a previous job the standard was three-spaces of indent, regardless of the language.
Tab is a statically-typed, functional, type-inferred language that occupies a niche between bash and python.
It's also not Turing-complete but can compute almost everything you could ever think of.
(I wish more languages aimed for Turing-incompleteness -- unsurprisingly, it turns out Turing-incomplete languages have big benefits for performance and resource management.)
> I strongly dislike macros that can hide in code. I get really frustrated when I open a source file and see (foo ...) and can’t tell whether it’s a function or a macro until I read documentation.
Well... that's just, like, your opinion, man.
Seriously though. In Elixir, for example, much of the language itself is implemented via its own macros, which demonstrates a certain nice extensibility. If Elixir followed this same pattern, it would get really annoying really quickly, as even simple if statements would require a leading slash.
Yep, it's my opinion, and that's why I put it into the design. Lots of language design comes from opinions. I hope it's borne out. FWIW it's the same approach Rust has taken, where macros have to end with a ! to make them visually distinct.
This is also true for Racket. The language is basically all macros built on top of each other. While this superficial distinction between macros and other constructs serves a purpose, I think that purpose is largely misguided and invented.
What is the need for knowing if it's a macro or not when you could just know how it works (what'll it spit out / do?)?
While I do believe in limiting stuff for the sake of simplicity, this notation will actually burden the developer into not using the macro system fully, simply because someone wants there to be a non-forced distinction between macros and other constructs in the code.
This looks cool -- is there any source code? What language is it written in?
"Tulip is still in active development, and I could use a whole lot of help, both filling in the design gaps here and actually churning out the implementation"
It's unityped! It has one type with infinitely many variants/tags (.<string>). Match failure occurs at runtime as in any other safe typed language such as Haskell or ML.
Yep! It focuses more on dynamic type-checks than on static typing though, so I put it in the category of "untyped functional" - more like clojure and erlang than haskell or ml.
“Unf” is quite widely used as a spelling of a moan, to express sexual desire or gratification. While it can be used to express non-sexual enjoyment, the sexual connotation it evokes is just unnecessary when it comes to a programming language, regardless of the original intent.
_pmf_|11 years ago
TazeTSchnitzel|11 years ago
https://github.com/TazeTSchnitzel/Firth/commit/7b9bf0b4c090e...
Thanks for the idea! :)
thomasfoster96|11 years ago
jewel|11 years ago
You'd have to actually run the language's parser in order to do the transformation to avoid changing strings, and even then it'd only work if the parser output kept track of the original line and character so that you could know where to make the change.
This sort of text-transformation is something I've long wished my text editor did. At a previous job the standard was three-spaces of indent, regardless of the language.
rdtsc|11 years ago
draegtun|11 years ago
And I agree with you that hyphens are more readable. They're also good for adding extra semantic meaning - https://news.ycombinator.com/item?id=3978992
otabdeveloper|11 years ago
Tab is a statically-typed, functional, type-inferred language that occupies a niche between bash and python.
It's also not Turing-complete but can compute almost everything you could ever think of.
(I wish more languages aimed for Turing-incompleteness -- unsurprisingly, it turns out Turing-incomplete languages have big benefits for performance and resource management.)
g8gggu89|11 years ago
lectrick|11 years ago
Well... that's just, like, your opinion, man.
Seriously though. In Elixir, for example, much of the language itself is implemented via its own macros, which demonstrates a certain nice extensibility. If Elixir followed this same pattern, it would get really annoying really quickly, as even simple if statements would require a leading slash.
Also, I preferred "unf" ;)
jneen|11 years ago
59nadir|11 years ago
What is the need for knowing if it's a macro or not when you could just know how it works (what'll it spit out / do?)?
While I do believe in limiting stuff for the sake of simplicity, this notation will actually burden the developer into not using the macro system fully, simply because someone wants there to be a non-forced distinction between macros and other constructs in the code.
giancarlostoro|11 years ago
Google Cache Text-Only:
http://webcache.googleusercontent.com/search?q=cache:cOp3ebJ...
jneen|11 years ago
chubot|11 years ago
"Tulip is still in active development, and I could use a whole lot of help, both filling in the design gaps here and actually churning out the implementation"
klibertp|11 years ago
duaneb|11 years ago
namanbharadwaj|11 years ago
jneen|11 years ago
wyager|11 years ago
Are fifth graders critiquing programming languages now? Seriously, who makes that association and then feels the need to comment on it?
jneen|11 years ago
evincarofautumn|11 years ago