3 ms·
I propose a minimum standard for all programming languages: show example code on the home page You will save the audience a lot of time, and be able to convey
by mkramlich 17y ago
I propose a minimum standard for all programming languages:
show example code on the home page
You will save the audience a lot of time, and be able to convey a lot about your language in a much more concise way. Great for that first taste.
- stralep 17y agoI agree... But it is not my web site :) For example, the set-valued expression {1..n} is the set of integers 1 through n, and {p in {2..n} | forall i in {2..p-1} | p mod i /= 0} is the set of primes through n. (The first vertical bar here is best read as such that, and the second as a pause.) http://setl.org/doc/setl.html#Overview http://setl.org/doc/setl.html#Overview
- gmartres 17y agoThat made me think of Haskell, so to compare here is the equivalent(and of course totally inefficient) Haskell version: [p| p <- [2..n], all (\i -> p `mod` i /= 0) [2..p-1]] So, has this language more to offer than list comprehensions?
- stralep 17y agoI believe, what Haskell is generating is list. What SETL is making, is set. Could this syntax be used over any monad? [edit] Of course, there are things like */[1..n] for finding factorial, but that is fold in Haskell. It's neat for scripting, and for me, for circuit complexity explorations.
- kapuzineralex 17y agoSo all the fuzz is about the fact that SETL has builtin support for sets? Really, I don't mean to be a troll, but is that it?
- alan-crowe 17y agoI find that example rather discouraging. Generating a list of prime numbers is an interesting toy problem because it comes with certain expections. The trial divisors are 2,3,5,7,9,... that is two and then odd numbers. One is supposed to stop early, when one reaches the square root of p, and one is supposed to detect this efficiently by looking at the quotinent and spotting that it is less than the trial divisor. This makes for messy code in any language. Which is very much the point. Will the language help you with the messiness of real applications? If the example ducks the challenge, that is a strike against the language.
- makmanalp 17y agoDefinitely agreed, that's one reason the jquery website wins. I don't want to dig through your documentation to get through to something tangible. Sometimes it's in "tutorials" sometimes it's in docs, sometimes it's plain not there or you need to download the whole package to get to samples. Shameful.