9 ms·
Copper: A statically-typed, loose syntax programming language
- mdaniel 6y agoGitHub doesn't recognize this enough to summarize it, and that last paragraph seems weird to me; is this a customized license of one that I might recognize? https://github.com/chronologicaldot/CopperLang/blob/master/license.txt https://github.com/chronologicaldot/CopperLang/blob/master/l...
- dcuthbertson 6y agoThe license seems self-contradictory. On one hand it says "THIS SOFTWARE MAY BE USED, MODIFIED, REDISTRIBUTED, DECOMPILED, DISASSEMBLED, REVERSE-ENGINEERED AND INCORPORATED INTO OTHER WORKS FREELY" So, it can be used and incorporated freely, but it also says "YOU ARE NOT GRANTED LEGAL AUTHORITY OVER THE USAGE, PROTECTION, AND DISTRIBUTION OF THIS SOFTWARE." so you don't have legal authority over its usage. IANAL, but that seems to limit one's own authority over one's own work based on this software. It's very confusing.
- nercht12 6y agoThe guy who wrote it isn't a lawyer either.
- Rochus 6y agoWhat you intend essentially corresponds to the two-clause BSD or the MIT license. Here is a good summary: https://opensource.stackexchange.com/questions/217/what-are-the-essential-differences-between-the-bsd-and-mit-licences https://opensource.stackexchange.com/questions/217/what-are-... Your statement "you are not granted legal authority ..." essentially means that you are the copyright owner and don't want to give away your copyright, but only give a license to others as explicitly stated; that's essentially the default in all jurisdictions I'm aware of, so you don't have to repeat it in your license. But if you're in US you might want to register your copyright.
- tom_mellior 6y agoI wonder what "loose syntax" is supposed to mean here. No semicolons at the ends of lines? OK. Optional commas between function arguments? Hum. But at the same time this seems to require colons after... what exactly? Variable read accesses in argument lists? Unintuitive and not exactly "loose".
- nercht12 6y agoNo semicolons are ever required. It is loose syntax in that most anything, including this paragraph, is valid and readable code
- tom_mellior 6y agoThat's still not very helpful to me. You might want to explain it a bit more in the README. For example, taking this line from the first example: this.peek = +(this.a: this.b:) If I replace this by: this.peek = +(this.a: this.b: (note the dropped closing parenthesis) and leave everything else as is, that will not be a syntax error? I know that Forth is "loose syntax" in that Forth code is just a sequence of white-space separated words, so your comment and mine are both syntactically valid Forth, but without meaningful semantics. But Forth does not use parenthesized function calls the way Copper does.
- nercht12 6y agoI see what you're getting at. Yes, a ) is needed... eventually. I think the key with "loose" is that it's forgiving. You won't encounter many syntax errors in average programming because the syntax has few rules. In that case, "very simple" would be better said than "loose".
- skohan 6y agoIsn't the trailing colon thing also in Ruby? I thought I remembered seeing something like this elsewhere where it also did not make much sense
- 6y ago
- throwaway_pdp09 6y ago(Edit: this comes across a bit aggressive, not meant so). What benefits does copper bring over other langs? Also loose is a bad move. Loose semantics proved a mistake (PL1), loose syntax brings nothing to the party. Semicolons were used in pascal because wirth understood parsing, and they are there to help the parser resync after a syntax error is detected. From experience if you make semicolons optional as in sql, it helps not at all, AND they are (said by microsoft to) become mandatory in future releases of TSQL, AND I and at least some other users of SQL want them mandatory. I also don't understand why a non-typical syntax is used. Not at all saying it's wrong but it seems to differ from other syntactic conventions only to be different rather than better (I may be wrong!). Why "gte(a: 100)"? Syntax matters to a degree, why diverge?
- kroltan 6y ago> Why "gte(a: 100)"? Syntax matters to a degree, why diverge? Not sure what about it are you criticizing? Local variable access using :? No commas between parameters? Operators using function call syntax?
- tom_mellior 6y agoNot the parent, but I personally don't like prefix syntax for such common operators. As for the colons combined with the absence of commas, this suggests keyword syntax to me. I.e., as if the gte function took one argument named a. Like this Python call: gte(a=100)
- deleted 6y ago[deleted]
- nercht12 6y agoActually, it can take multiple. gte(a: b: c: d:) is equivalent to (in C) a >= b && a >= c && a >= d. By making operators like functions, you can group like-operations and simplify code. Admittedly, it's not as readable for someone accustomed to seeing C style. Last note: gte(a=100) would produce an error in Copper because a=100 is an assignment statement that returns "a" (a function), and gte( function ) means nothing. Edit: I see you're referring to Python, but I figured I'd keep the note of comparison.
- wool_gather 6y agoMight have been better to link to the docs (https://chronologicaldot.github.io/CopperLang/ https://chronologicaldot.github.io/CopperLang/), where the "simplicity" part of the pitch is made clearer, as well as the inspiration from JS and Lisp. Reading through them, it seems like an interesting language concept/experiment.