r/Clojure • • Sep 14 '17

I just started learning Clojure, I love it but the documentation is just about the worst thing ever

I come from the land of C/C++, Java, Javacript, C#, Python etc...

You'll notice Lisp isn't on that list, I thought it was just a myth up until a little while ago.

So sure enough I started reading about Clojure, and so far so good, honestly the syntax is nice and it's pretty straightforward. I love pure functions and immutability and all that jazz.

But the documentation, Jesus the documentation...

Empires rise and empires fall based on their documentation.

You write a program and don't document it, a few months later it's like your own code is a monster from the abyss.

You build an airplane and you don't document and train people in it, and million dollar giant metal beasts fall from the sky.

You write a programming language and you don't fucking document it, and it'll die. It'll just die.

Let's compare good documentation to Clojure.

Let's say, in Javascript, I want to find the size of an element. I have no idea how to do this, so I Google: "javascript get element size".

If you ignore the stackoverflow spoon feeding, you get this:

https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements

Look at it. It's beautiful.

Now I know I can, for example, do element.getBoundingClientRect() and I'll get somewhere.

Now let's look at Clojure.

Let's say, I don't know how to get user input. Standard problem for someone new to Clojure, or just programming in general.

So you Google: "clojure get user input".

Once again we'll ignore the stackoverflow spoon feeding, because what happens if stackoverflow hasn't answered it yet? It does happen when you face something that's a little beyond the beginner level.

So we see:

https://clojuredocs.org/clojure.core/read-line

It's a bloody disaster innit?

Let's see what exactly is the problem here.

read-line

(read-line)

Reads the next line from stream that is the current value of in .

(read-line) is how you use it, fair enough, no problems there.

"Reads the next line from stream that is the current value of in ."

You fucking what mate. What is "in"? No link to in, it just says "in".

You google "clojure in" you get nothing of value.

Pretend I don't know what "stream" is, what is this even saying to me?

The one thing that's great are the user examples, but that is also its downfall as I'll show in the next example.

Let's say I'm reading some javascript code. I see this: something.querySelector() and I don't know what querySelector() is. So I google it.

https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector

Look at that. Again, it's beautiful. It doesn't just have one line of documentation, it has a whole page.

Next we're back to Clojure.

And I see this (doseq [somethinghere] (morehere)) and I want to know what doseq is.

https://clojuredocs.org/clojure.core/doseq

(doseq seq-exprs & body)

Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for". Does not retain the head of the sequence. Returns nil.

First of all, sequence-expressions or sequel express or sesquash experiment? The fuck is it? Clojure's constant use of shortened variables / functions etc... is infuriating.

Also if I didn't already know what & does I'd be completely lost there.

Now for the short description of what this thing does:

Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for". Does not retain the head of the sequence. Returns nil.

Presumably for side-effects is it? What if I don't presume, what the fuck does it do then? With bindings and filtering as provided by "for", oh no, not again! For!??! No link to for. Google time.

https://clojuredocs.org/clojure.core/for

Now I've got a whole 'nother set of documentation reading issues and all I wanted was to know what doseq does.

I said before that the examples weren't enough here, this is why:

Look at the first example, the issue here is that I didn't google "how to multiply every x by every y", it's a completely arbitrary problem and solution and really it doesn't explain what doseq actually does, just shows what it could potentially do. These are two separate issues.

I've run out of steam here, point is documentation please. Comments in the code please. Don't shorten your variables from 3 words to 1 letter please.

Keep the "examples" in the documentation, but I think it would be more important to add Related Links and User Explanations, out of all the users at least one or two should be an English teacher, I hope, otherwise we're screwed.

PS: Perhaps the biggest problem is that I can't even imagine how people learnt this language before https://www.braveclojure.com/ was written. The documentation on the main Clojure website I'm sure wasn't written for humans, maybe not by a human either.

PSS: /u/moxaj posted this link down below: https://www.youtube.com/watch?v=nrpsMB2gYI0

It doesn't have as much profanity (surprisingly) but it also says a lot about the state of Clojure's documentation. Honestly it paints an even worse picture than I thought, as soon as anything Clojure-like (is there already something?) but with better documentation comes along, Clojure will basically die. That's my prediction. Unless Clojure can start treating documentation seriously (both internally and externally).

97 Upvotes

108 comments sorted by

23

u/weavejester Sep 14 '17

I find the Clojure API documentation clear and concise... but I suspect that's the problem. I've been using Clojure for some time, so I understand the idioms, and before that I had worked in other functional languages.

The for macro is documented as:

List comprehension. Takes a vector of one or more
 binding-form/collection-expr pairs, each followed by zero or more
 modifiers, and yields a lazy sequence of evaluations of expr.
 Collections are iterated in a nested fashion, rightmost fastest,
 and nested coll-exprs can refer to bindings created in prior
 binding-forms.  Supported modifiers are: :let [binding-form expr ...],
 :while test, :when test.

(take 100 (for [x (range 100000000) y (range 1000000) :while (< y x)] [x y]))

Which is clear enough to me, if a little dense. However, based on the standards of MDN, this would warrant a whole article of explanation.

I wonder if it would be worth setting up a wiki (perhaps on Github) that would contain more detailed explanations about the various functions. Perhaps it could be then fed into sites like clojuredocs. Has anyone done this already?

13

u/amalloy Sep 14 '17

Isn't that already exactly what clojuredocs is supposed to be? Instead of building a new aggregator site, just contribute more information to clojuredocs.

9

u/weavejester Sep 14 '17

ClojureDocs doesn't appear to have a way of updating the description of the function. You can add examples and notes, but you can't actually change the explanation of the function itself to make it more like the MDN function descriptions.

15

u/yogthos Sep 14 '17

Might be worth talking it over with the maintainers, it seems like something that could be added with relative ease. I think the fact that there are many different sources is itself a bit of a problem. ClojureDocs is probably the most popular source right now, it would be better to improve it than to create another one.

3

u/__tosh Sep 14 '17

would be great to have an additional github-like markdown area on there as well

8

u/yogthos Sep 14 '17

Definitely, would also be cool to integrate klipse so people can try examples right on the site.

0

u/[deleted] Sep 14 '17

[deleted]

2

u/yogthos Sep 14 '17

Yeah klipse runs in the browser, so it wouldn't work for any Java specific stuff. I still think it would be pretty handy for a lot of the examples, but would be inconsistent if only some code ran that way.

Another option could be to use a similar approach to 4Clojure and run a server-side REPL.

2

u/ForgetTheHammer Sep 15 '17

On the Defn Podcast they interviewd the creator of Klipse about using it the Core docs (in some way). The idea was shot due to performance ideas or something. You might want to check with him for the details.

3

u/yogthos Sep 15 '17

Klipse is pretty heavy and it requires unminified ClojureScript to work, so it weighs in at about 5 megs. One approach could be to have a button to enable the interactive mode, so you can have things load quickly, and opt into interactive examples.

3

u/unknown-unit Sep 15 '17

I'm fairly sure the function descriptions are taken directly from the function docstring in the source code by an automated process. Changing the description on clojuredocs means either a) changing the docstring (bad idea, imo - if you were looking at source code would you want to see that MDN description on every function?) or b) manually editing every page to include an expanded version of the docstring.

I think the docstring should be left alone, and a section added which expands on it. I still think the examples in general are good, but something which explains unclear terms would certainly help for beginners.

6

u/yogthos Sep 15 '17

Yeah, I think it would make sense to leave the docstring along, and add a separate section with the explanation. I agree most of the examples are good, and provide a quick way to see how the functions are used.

The MDN format is actually pretty nice in my opinion. It starts with a description of the purpose of the function, then explains the syntax, and follows with examples, and more details at the end.

2

u/weavejester Sep 15 '17

I think it would be more difficult than it might first seem. You'd need a wiki-like functionality, with an immutable history that could be reverted, so that a page's description could not be lost by a single change. You'd also probably want markdown support and previews. That's not to say it's an insurmountable problem, just that it would require a bit of work.

The reason I suggest an existing wiki is that solves the editing and maintenance problems, and the resulting documentation could be pulled periodically to enhance sites like ClojureDocs, or even incorporated as articles for the official Clojure site.

2

u/yogthos Sep 15 '17

The way I've been handling it for Luminus is to keep all the docs as Markdown on GitHub. It addresses having a history, and so on, and it also makes it easy to contribute since anybody can just edit the docs on the site, and open a PR.

1

u/Carr0t Sep 15 '17

I assume that's because the function description part is updated based on the docstring of the function in the source, so the way to update that is to contribute a source patch.

Additional explanation apart from just examples would be nice though.

(On a side note, it's cool to see a name here that I recognise from GitHub because we're using a number of your libs in our projects. Thanks for all the work you've put into them! :))

9

u/SuperOdie Sep 15 '17

In case anybody is interested...

I just started something along those lines. Basically, keep the documentation/docstring for a function in a markdown file. A nREPL middleware then catches doc requests from CIDER and injects/replaces the documentation with the contents of the markdown file.

The relevant links are:

https://github.com/Odie/sidedocs-nrepl

https://github.com/Odie/sidedocs-clj-api-docs

The hard part isn't how we get the documentation to where we need it to be though, it's actually writing the documentation. Besides the fact that good documentation is hard. I believe there is some 500+ core API functions.

3

u/DiscoUnderpants Sep 15 '17

Frankly I prefer the above and wish a lot of documentation writer would tone it down a little. I don't need a history lesson when I just wanna know how to get the size of an array. One of the worst in my memory was the javadoc for the Calendar object... it included a history of the the Gregorian calendar ffs.

1

u/[deleted] Sep 14 '17

A wiki would be a great.

For example the https://vim.wikia.com is invaluable for vim scripting. Though vim itself also has ridiculously good documentation that any project could learn from.

2

u/pr06lefs Sep 14 '17 edited Sep 14 '17

You've got to read that extremely carefully to glean that you'll get every possible combination of the values of x and y. We don't need our documentation to be as terse as our code.

1

u/__tosh Sep 14 '17

love the idea, would lower the barrier to contribute, right now I would not know how but would be motivated to do so

55

u/alexdmiller Sep 14 '17

We all love a good rant, but then again, maybe taking a dump on someone's lawn is not the best way to start a conversation. Just a thought.

Clojure's docstrings are intentionally written as a concise summary of what a function does that implicitly assumes the context of a knowledgable Clojure user. What I hear you saying is that Clojure's docstrings do not work well as a way to learn the language. I agree (and that is not their intent). Most users of a language are beginners for a few weeks or months, then slowly become intermediate or expert users for years (or soon, decades). The docstrings target the latter.

Many people seem to assume that Rich or the core team are hostile to documentation other than the docstrings, when this is absolutely untrue. Clojure has a means to unambiguously refer to vars via namespace. This provides the opportunity to create and merge multiple sources of documentation into a single combined view that can be useful to different kinds of users (beginners, new host implementers, perf-minded users, whatever). No one seems to think about things like that docstrings go into the core AOT'ed classes, increase the size of Clojure, and significantly impact core load times (another popular pain point).

You could even have an API that would show you merged docs in your REPL. Oh, wait - that already exists! Or at least it used to (http://api.clojuredocs.org - not responding, https://github.com/dakrone/clojuredocs-client). If someone wanted to make that work again, that would be cool. I used to use it back when I was learning Clojure. In 1.9 we're adding specs automatically to doc output - that often gives you another critical layer of detail (merged from a secondary registry).

People have also taken the time to write extended docstrings for Clojure. Andy has done a ton of work in https://github.com/jafingerhut/thalia for example. Maybe someone could work on a means of merging that stuff with core and clojuredocs? That would be cool.

If you want a long form guide to something, maybe consider writing one for https://clojure.org/guides/guides!

Learning things is inherently effortful - there is no docstring that can explain to you the 100% backstory behind read-line. When learning any new language, you will repeatedly encounter things you don't understand. The documentation will always leave something unanswered or implicit. Effort will be required to take that next step and connect a few more dots. A few months down the line, you may read the same thing and know exactly what it means. Or maybe you won't and it could have given you a key clue that would help. File a jira with the problem. Supply a patch. Contribute to a doc web site. Write a library. Do something of value rather than write a 2-page rant on reddit.

If you want a thing, make a thing! Nothing and no one is preventing the community (you!) from doing this work. I know, I know that sounds like a lot of work. It sounds like a lot of work to me, too. And I have all this other work! Doing things you also care about!

I have spent months, maybe years!, of my life writing docs for and about Clojure. It's hard, it takes a long time, and all people ever do is endlessly say that it sucks. I sat here and wrote this stupid response instead of finishing five features for the new Clojure cli that will be super useful for beginners and could even theoretically include new sources of documentation. Hey, cool idea, too bad I'm on Reddit instead of doing that.

9

u/[deleted] Sep 15 '17 edited Sep 15 '17

I don't want to argue through your entire post, and you make some good points, but this just sticks out for me.

If you want a thing, make a thing! Nothing and no one is preventing the community (you!) from doing this work.

That's a bit like a car manufacturer saying if you don't like our cars, build your own!

Who cares if we haven't provided the manual to go with your new automobile, or if it's written for engineers that already know how every screw and piece of metal fit together.

All you need to do is pull the car apart, study it for a few years and then come back and improve our documentation for us.

You want me to contribute documentation to a place that doesn't let you contribute documentation (easily) while looking for documentation on the thing I want to contribute to?

Usually the most knowledgeable people on a subject are the ones that write about the subject, because they're knowledgeable about it, they're the only ones that actually can.

0

u/[deleted] Sep 15 '17

[deleted]

5

u/[deleted] Sep 15 '17 edited Sep 15 '17
  1. You won't be helping just me, you'll be helping everyone including yourselves. What happens when you go back to your code and you forgot what it was about? Good commenting / documentation is for everyone's benefit. Writing good documentation is part of the job of writing good code. Also if you want the community to grow, then it needs to be fed something healthy.

  2. What other language project has this issue? What makes Clojure so special compared to everything else out there that it doesn't need to be documented?

5

u/ForgetTheHammer Sep 15 '17

This is interesting to me as well as you, so i'm explaining it to myself as well as you.

I dont think anyone is claiming the docs couldn't be better for some audiences. Alex has explained that their are ways to make that happen, but that it won't happen through the main ClojureAPI which are terse by design. For Example the ClojureDocs accepts pull requests so the barrier to entry their isn't more then you will find in other languages.

3) As far as problems in other languages, i spent 4 minutes looking for the definition of the cond function in Elixir and couldn't find it. Should i go rant on r/Elixir now? Maybe, I would behind a safety net of anonymity, but if my reputation is on the line I would have more decor and respect when approaching a subject i know little about.

7

u/[deleted] Sep 15 '17 edited Sep 15 '17

Took me 10 seconds and I have no idea what Elixir even is.

https://elixir-lang.org/getting-started/case-cond-and-if.html#cond

Compare with Clojure:

https://clojuredocs.org/clojure.core/cond

It's shit.

Take it from an experienced ranter, if you want to rant about something, you first need to make sure it's a good topic. ;)

1

u/ForgetTheHammer Sep 15 '17 edited Sep 15 '17

https://elixir-lang.org/getting-started/case-cond-and-if.html#cond

I found that link to. That page has examples of how cond is used but lacks a definition for the function itself.

Not to mention you could level the same arguments against it that you used other places.

case is useful when you need to match against different values. However, in many circumstances, we want to check different conditions and find the first one that evaluates to true. In such cases, one may use cond:

e.g Whats a "case". Why does it assume i know what that is?

The ClojureDocs on Cond have both a definition and Examples

https://clojuredocs.org/clojure.core/cond

The point here isn't to say the documentation can't be improved, but to say that it wouldn't be a trivial task. I dont think i personal could change the docs without making them less clear for some other audience. I would need to know more about the goals and focus.

5

u/[deleted] Sep 15 '17 edited Sep 15 '17

You're splitting hairs here.

When I googled for elixir cond, it came up with the entire page.

"case, cond, and if" is the title, so you know they're all related.

Also you say it lacks a definition, but the definition is right here:

However, in many circumstances, we want to check different conditions and find the first one that evaluates to true. In such cases, one may use cond

So it's the same as case, except used to check conditions.

It builds on the knowledge of case, sure, but it's on the same page, also everyone and their pet Emu knows what "case" is in programming.

Also you might notice two things.

If you scroll down on this page:

https://clojuredocs.org/clojure.core/cond

You'll see somebody saying the documentation isn't accurate.

If you scroll down on this page:

https://elixir-lang.org/getting-started/case-cond-and-if.html#cond

You'll see "Is something wrong? Edit this page on GitHub. "

PS: The answer to Clojure's documentation problem isn't to tell people "stop rocking the boat!", it's to suck it up and put a decently high priority ticket into JIRA. Wiki says Clojure has been around for about 10 years, I wouldn't be surprised if there was already a 10 year old ticket about documentation floating around somewhere in the bowels of the beast.

1

u/ForgetTheHammer Sep 15 '17

Were both splitting hairs then.

When I googled for elixir cond, it came up with the entire page.

Same with Clojure.

Also you say it lacks a definition, but the definition is right here:

However, in many circumstances, we want to check different conditions and find the first one that evaluates to true. In such cases, one may use cond

A function definition typically tells me at least the Arity of a function.

(cond & cluases) tells me that cond takes any number of clauses.

Is there a limit to how many conditions i an pass Elixirs cause? That knowledge is implicit, its Explicit on the clojure definition. Is that splitting hairs? Yea, but thats the level we have taken the conversation, were actual getting closer to identify a gap in one set of documentation vs another.

You'll see somebody saying the documentation isn't accurate.

Is that person right? Are they wrong? I dont know, i dont know them so i can't trust them. I could read their argument but it might be outdated. Actual, proving my point, the next commentator shows how their output is wrong. So the comment about the function definition being wrong from a non official source is wrong.

This actually exposes the trade off of making it easier to change or even comment on the official documentation page. Now those other explanations have to be groomed, maintained and edited by trusted sources or else they will confuse newcomers.

If you scroll down on the Elixir page You'll see "Is something wrong? Edit this page on GitHub. "

Sorry if you missed all the hints on the ClojureDocs page where you could "Log In" to add

  • an Example

  • a "See Also"

  • A Note

So notable this lacks a place to offer an alternative description. I would recommend you read Yogthos comments on this idea in this very post. Did you find the process of making an account and adding a Note to the ClojreDocs harder or easier then other document changes to other languages?

1

u/[deleted] Sep 15 '17

Fair points, I'd still say Elixir docs are more understandable between the two examples, but I won't dwell on it further.

→ More replies (0)

1

u/namesandfaces Sep 16 '17

That's like a blog entry on the main website I wish they'd stylistically update; this is what I would refer to as docs:

https://hexdocs.pm/elixir/master/Kernel.SpecialForms.html#cond/1

1

u/ForgetTheHammer Sep 18 '17

https://hexdocs.pm/elixir/master/Kernel.SpecialForms.html#cond/1

Thanks! I knew it was out there somewhere. Look at those docs i find them comparable. Though the Elixir site has a syntax highlighting and a better ... look. I think its pretty cool that if you click the Elixir link in the docs it takes you to even more expanded docs. Though i would be worried about how they keep those in sync with the language itself.

1

u/namesandfaces Sep 16 '17 edited Sep 16 '17

That's like a blog entry on the main website I wish they'd stylistically update; this is what I would refer to as docs:

https://hexdocs.pm/elixir/master/Kernel.SpecialForms.html#cond/1

5

u/yogthos Sep 15 '17

I completely agree that Clojure documentation could be a lot better, and it's something I've been advocating for a while. That said, one thing that makes Clojure a bit special is its REPL.

When I started learning it 7 years ago, the docs situation was far worse than it is today. As a beginner I found official documentation completely useless, but being able to run functions in the REPL and see what they're doing was really helpful when I was learning. I could try different inputs, play around with examples, and get a feel for what a function does by using it.

While other languages have REPLs as well, Lisps take the concept a lot further. The REPL isn't just a toy on a side, but an integral part of the workflow in Clojure. If you're not using the REPL from your editor currently, I highly recommend getting that setup. It'll help with a lot of the beginner frustrations.

4

u/Carr0t Sep 15 '17 edited Sep 15 '17

Honestly all I've ever used is clojuredocs and I've never had an issue interpreting what that gives you given what I know about how other programming languages work (e.g. I knew I was most likely looking for a stdin equivalent with read-line, and googling that quickly gave me *in*. I might even have just searched for 'in' through the search bar on clojuredocs, I can't recall).

11

u/heyzk Sep 15 '17

ClojureDocs maintainer here.

On the CD API, it's just a time thing. I'll get to it at some point. Thalia is new to me, but Andy Fingerhut does good work so I'll investigate what it would take to get that in.

Really looking forward to 1.9, thanks for all the hard work!

6

u/MR_ZORRR Sep 14 '17

Alex, thanks for your all your hard work.

I love the core docs, and the fact they are experienced at knowledgeable users. Yes, they make me feel stupid sometimes - and that's a good thing. It points me in the direction of what I need to learn to get better at it.

Whenever the docs are too concise, see alsos and exemples on clojuredocs.org are always enough to get me on the right track. If 20mn later I'm still puzzled, I know a gentle soul on Clojurians #beginners can help me out.

In short, thanks for all the fish.

5

u/againstmethod Sep 15 '17

Fair points but I think his point is that clojure is in competition for mindshare, but is leaving obvious stumbling blocks for learners.

I didn't find it quite as dramatic as he seems to have, as I just bought a couple books. I'm a book guy.

But to ask him as a new user of the language to update the docs as a part of the learning process is outlandish.

6

u/stefan_kurcubic Sep 14 '17

my god you are composed man your wife must be happy :D

good points VERY good points thank you for energy that you put in community

14

u/alexdmiller Sep 14 '17

My wife wishes I spent less time writing books about Clojure in my free time. :)

2

u/ForgetTheHammer Sep 15 '17 edited Sep 15 '17

You could even have an API that would show you merged docs in your REPL. Oh, wait - that already exists! Or at least it used to (http://api.clojuredocs.org - not responding, https://github.com/dakrone/clojuredocs-client). If someone wanted to make that work again, that would be cool. I used to use it back when I was learning Clojure. In 1.9 we're adding specs automatically to doc output - that often gives you another critical layer of detail (merged from a secondary registry).

Hi Alex. This sounds interesting, where could i learn more?

I have spent months, maybe years!, of my life writing docs for and about Clojure. It's hard, it takes a long time, and all people ever do is endlessly say that it sucks. I sat here and wrote this stupid response instead of finishing five features for the new Clojure cli that will be super useful for beginners and could even theoretically include new sources of documentation. Hey, cool idea, too bad I'm on Reddit instead of doing that.

I appreciate your hard work. While I can't recommend being on reddit. I'll at least let you know that your post here helped me understand some options I could contribute back the community.

1

u/alexdmiller Sep 15 '17

Hi Alex. This sounds interesting, where could i learn more?

See https://clojure.org/guides/spec and search for "doc". Or at a 1.9 repl, try: (doc defn) or (doc let) etc.

12

u/dustingetz Sep 14 '17 edited Sep 14 '17

I can't even imagine how people learnt this language before https://www.braveclojure.com/ was written

I read a book: Joy of Clojure, hope this helps

2

u/[deleted] Sep 14 '17

I'll definitely check it out, thanks.

7

u/WalterGR Sep 15 '17

The Joy of Clojure is not for Clojure beginners.

3

u/[deleted] Sep 15 '17

Really? It looks pretty good so far, I'm actually finding it better written than Brave Clojure and the coding style is much more readable too. For anyone that's done at least a little bit of coding before it seems like a decent fit.

1

u/dustingetz Sep 16 '17

Joy of Clojure was my first clojure book and i loved it

4

u/lgstein Sep 14 '17

If you come from Java/C++ land, "Programming Clojure" by Halloway is also an excellent resource.

3

u/[deleted] Sep 14 '17

I read Programming Clojure and Joy of Clojure, then the reference documentation on https://clojure.org/reference/reader which I think is very good. Short and readable for a reference, and very rich in information. It felt like I learned more from the (shorter) reference than the books. But maybe I would have struggled more with it if I hadn't read the books.

Also, there are not very many functions you have to know. Once you know the 50% most common ones in clojure.core, you are pretty much fine.

I have never found the documentation to be a problem. I don't really get what people mean when they complain about it. You are the first one to explain it in some detail, but I think the documentation for doseq, for example, is fine. It's easy in most editors, I think, to just invoke some command and get straight to the documentation of for if you need to after having read the docs for doseq. Same with *in*, just jump to it.

15

u/__tosh Sep 14 '17

I would love to see MDN-like documentation for Clojure(Script)

12

u/thundergolfer Sep 14 '17

As very much a clojure novice, I agree with this. One thing that was annoying me today is that things that should very clearly be links are not links, like java.io.InputStream in here.

In that same page, they mention String, which is capitalised so it's clearly some named entity in the language. Is it a hyperlink? Nope.

11

u/totemo Sep 14 '17 edited Sep 15 '17

One thing I would say that the Clojure docs get right is the examples. There are lots of them and they're a good starting point for playing with things in the repl.

7

u/[deleted] Sep 14 '17

Javascript has been around for 20 years, is available on every computing device on the planet, and probably has 2 orders of magnitude more programmers working in it than clojure.

Regardless, if you want to learn a new language then read a book/tutorial/guide about the language. Don't just start googling random things to try and do. The way people learnt the language prior to those beginner resources were written was only experienced programmers learned it, for whom API documentation and an understanding that the language is running on the JVM was adequate.

13

u/unknown-unit Sep 14 '17

I learned Clojure on the job, without any reference to braveclojure or any books.

I have usually found the documentation to be clear and helpful. The doseq page is full of examples, and the "presumably for side effects" seems clear enough to me: doseq returns nil, so if you're not calling it for side effects, what is your use case?

Related functions can be searched for, and are linked below the examples.

Can the documentation be improved? Probably. It's perhaps a little dense and intimidating for beginners. Though I personally find it much better than the Python docs.

The abbreviations you get used to. They make sense after a while. I'm not a fan of overuse of abbreviations but I have no problem with those in Clojure.

Since your other comments seem to have been hidden below the threshold, I want to comment on the parentheses. I avoided Lisp of any sort for a long time because of those damned seemingly unnecessary parentheses. Here are two things I learned:

(1) Almost every language has as many parentheses. They're placed differently and many of them are "{}" instead of "()".

Good code uses short functions. Short functions mean you don't need a lot of closing parentheses. After a while, you just get used to them being on one line. And they're less in the way than when on multiple lines pushing related functions further apart vertically.

(2) This is the important one. It's why everything is in parentheses. Lisp is homo-iconic. A function is a list. A namespace is a list of lists. A program is a list of lists. This is an unbelievably powerful thing. Not that you will often need to, but it means you can quite literally treat code as data. Clojure leverages this a lot in the core. Quite a few things which look like functions are actually macros which treat code as data.

Someone commented "at some point you'll probably start to like parens more than other kinds of syntax" - well, I've gone from "that's just horrible syntax" to "best syntax ever."

You said "you can never quite fully get rid of the noise" - it was gone from my brain in a matter of a few days. I almost don't see the parentheses anymore, and they're less noise for me than the syntactical structures of OO languages.

I second the recommendation for Joy Of Clojure. I bought this only when I was already fairly familiar with Clojure, but it has been helpful for taking my understanding further, and I expect it will be great for a beginner.

I would also recommend Jay Fields' Blog: http://blog.jayfields.com/search?q=clojure

6

u/pr06lefs Sep 14 '17

One that gets me is reduce.

f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val is supplied, returns the result of applying f to val and the first item in coll, then applying f to that result and the 2nd item, etc. If coll contains no items, returns val and f is not called.

It would be nice if it told you which arg to f is the accumulator and which is the value. Is it (f accum value) or (f value accum)? You have to experiment yourself, pretty much.

1

u/prakashk Sep 14 '17

It would be nice if it told you which arg to f is the accumulator and which is the value. Is it (f accum value) or (f value accum)?

I think this sentence from your quoted text has a hint (emphasis mine):

... If val is supplied, returns the result of applying f to val and the first item in coll, then applying f to that result and the 2nd item, etc.

Based on the order, I would think val (the accumulator) is the first argument, and the item from coll is the second argument to f.

I am not a clojure programmer, so I am sure I will be corrected if the above is wrong.

3

u/[deleted] Sep 15 '17

You're not wrong, you're correct. It's also how reduce is implemented in every other language I can think of so there's a bit of "assume the person reading the terse programmer documentation is actually a freaking programmer" going on there. If you're a beginner programmer then read beginner resources/books ffs, and yeah some of them will cost money.

5

u/Baoze Sep 15 '17

yes, the documentation of core library is very terse and for me as an advanced beginner sometimes hard to follow. Though with more experience it gets better.

I found that the book Clojure Standard Library: An Annotated reference is adressing this pain-point quite well. It's currently still in MEAP but has already over 300 pages and I think the 28$ are well invested (reduced price with the code "ssborgatti": https://www.slideshare.net/ManningBooks/clojure-standard-library).

The author has also a weekly screencast on Youtube explaining the core function in depth. The explanations are very extensive, but very helpful. You might want to give it a shot.

5

u/alexdmiller Sep 15 '17

Now imagine if all that info was in the source and how large ithe docstrings would be.

4

u/[deleted] Sep 14 '17 edited Sep 14 '17

Documentation is hard.

My feeling is that it's harder without clear goals because you can end up burning out before finishing and ending up with inconsistent quality/completeness.

Here's my 3 step approach to getting us off on the right foot

  1. As a community we agree on a handful of real world examples of projects providing the types of documentation we aspire to. (This helps us see what we value most. This also gives us a chance to ask how it came to be written and maintained and if it's practical to do)

  2. We need to choose some small achievable milestones which move us closer to those goals. (This gives us an action plan and real progress metrics.)

  3. We tick off those milestones as they are achieved. (This gives us motivation and a sense of progress)

============

My opinions in that context

Two best documentation sources in my experience have been

  • the Django documentation which provides guide style information which contextualises apis with best practices and examples

  • the PHP manual (!) which provided just enough information to make good use of specific functions plus user contributed examples which were generally what I was looking for (effectivley stack overflow style responses to common needs)

Milestones I think are small and achievable from here

  • Improving clojuredocs to have a few paragraphs per function covering common use cases and gotchas.

4

u/jeepers76 Sep 15 '17

The thing that rings true to me about this is the linking within the docs - eg doseq linking to for. It would be nice if there were some syntax within the doc string to make it easier for tools (IDEs) or sites (clojuredocs.org) to generate links from the doc. Could be as simple as fully namespace qualifying symbols within the doc. Eg rather than

with bindings and filtering as provided by "for"

Use

with bindings and filtering as provided by clojure.core/for.

So that tools can find namespaced symbols and generate appropriate links.

7

u/dustingetz Sep 14 '17

Count the parens

document.querySelector()
(.querySelector document)

Functional programming involves composing a lot of functions, that's a good thing.

3

u/nonrecursive Sep 15 '17

Perhaps the biggest problem is that I can't even imagine how people learnt this language before https://www.braveclojure.com/ was written.

As the author of https://www.braveclojure.com/, I learned mostly by reading the excellent Clojure Programming; writing small, stupid web sites; and writing an introductory Clojure book.

7

u/kanzenryu Sep 14 '17

The error messages make the documentation look like gold.

3

u/lgstein Sep 14 '17

You are too impatient. While it is not always convenient that you need to be patient learning Clojure it will be rewarded. Trust me when I say that it's worth it more than in any other language. Once you have internalized the primitives, tech lingo and documentation style, you start to move fast and faster like in no other language.

1

u/agumonkey Sep 14 '17

You're both right and wrong. It's culture shock. Many lisps use an in dynamic variable representing what others call stdin (btw, if you read documentation talking about stdin, would you question its meaning ?)

Clojure doc is a bit terse, but it's alright. I wish it was a bit more like scheme RnRS alas.

-2

u/madmax9186 Sep 14 '17

You fucking what mate. What is "in"? No link to in, it just says "in".

It's obviously Standard Input. It's not unreasonable to expect a programmer to know that.

Pretend I don't know what "stream" is Then you google "Clojure stream" and see https://clojuredocs.org/clojure.java.io/input-stream as a result. It explains that it coerces its argument to a java.io.InputStream. You can then correctly deduce that a stream is a Java stream object.

With bindings and filtering as provided by "for", oh no, not again! For!??! No link to for.

Yes, there's no link in the docstring itself since that is hoisted straight from the Clojure source, I believe. But at the bottom of the page (under "See also") there is a link to for. I can see why there isn't documentation for how bindings operate; if they placed the for documentation there, then suddenly that information is in two places, both needing maintained. By leaving it only in for's documentation, they only have to worry about potentially updating a single place. Makes the documentation more correct, but requires more work by the user.

16

u/[deleted] Sep 14 '17

It's obviously Standard Input.

Except it's not! It's a var which can be bound to a LineNumberingPushbackReader (different from an InputStream!) which wraps standard input but is often rebound to something approximating it which comes over an nrepl connection and has nothing to do with System/in, which is similar but not exactly the same thing as /dev/stdin.

5

u/Baoze Sep 14 '17

that is a beautiful explanation of the "in" var! It finally helped me the connect the pieces and yes, exactly this kind of info is missing in the docs.

4

u/[deleted] Sep 14 '17

By leaving it only in for's documentation, they only have to worry about potentially updating a single place. Makes the documentation more correct, but requires more work by the user.

The behavior of for and doseq has never changed in the nine years since they were implemented.

This might have made sense in 2008 but makes no sense today.

-25

u/[deleted] Sep 14 '17 edited Sep 14 '17

Don't get me started on why we need so many parentheses. Python can make-do with indentation, but if Clojure wants 1000000 unnecessary clojures (see what I did there?))))))))))) at the end of every line, who am I to judge.

<edit> The parentheses must double as pitchforks since there are so many. And I haven't even mentioned how much better Vim is compared to Emacs.

8

u/[deleted] Sep 14 '17 edited Sep 15 '17

This has always been a big grip against Lisps and is very understandable. For most people coming from languages with C-like syntax, the parens seem excessive and frankly grotesque. However, the more you learn about Clojure the more you'll head the term homoiconicity come up. A lot of people with refer to this as 'code is data' mentioning things like 'there is only one syntax' or 'simple syntax'.

Clojure is a homoiconic language. What that means is the language has the same structure as it's abstract syntax tree. In human (read Non-Rich Hickey) terms, this means that when you write code, you're just building data structures.

If you look at Clojure code, everything is written as;

  1. Open paren

  2. Operation (function or macro)

  3. Body

  4. Close paren


This can be very good for people who understand how it works. However, this can be awful for new comers.

For the experience Clojure developers it's great because it feeds into the Clojure philosophy incredibly well. I've been writing Clojure for a few years now and I haven't thought twice about the parens. It comes from experience and understanding.


Python can make-do with indentation...

You're correct, it can. So can Java, JavaScript, C, C++, Go, Swift, Haskell, and just about every other mainstream language out there. However, metaprogramming in those languages is profoundly difficult. In Clojure, it's exactly the same as regular programming.

Take this absurd example of metaprogramming for instance (I'll give you a couple of real examples in a bit).

Write a bit of Python code to evaluate any given Python expression backwards at runtime.

I don't know how to do that because I don't know Python.

But think about the monstrosity you'd have to pull together to make sure that your Python code could read any backwards Python code at runtime.

Now, in Clojure, I can do that.

(defmacro backwards [form] (reverse form))

(backwards (2 2 +))
;;=> 4

Alright, that might be the most absurd example of metaprogramming ever, let's find a more useful one.

In Clojure, there's a great macro called if-let. The documentation reads,

bindings => binding-form test If test is true, evaluates then with binding-form bound to the value of test, if not, yields else

This works like,

( ... (if-let [x (even? 4)]
         "x is even"
         "x is odd") ... )

The way that this works is through some pretty neat Clojure macro programming, check out the code if you'd like. In Clojure, this is a pretty straightforward process to write code that can do this stuff though. Since the Clojure language is homoiconic, extending syntax like this is very simple. However, if you want to build something like this in Python to work on any Python code given to it, you'd have to change the compiler itself.


I'm not a great writer and I hope I didn't just overly confuse you. Homoiconicity isn't just useful for metaprogramming though, but I don't want this great wall of text to get too much bigger. For a more in-depth view of the ideas that Clojure is built on, I strongly urge you to watch some of the top videos on the ClojureTV channel. Clojure for Java Programmers (part 2) I think might be very appropriate for you. As well as Simple Made Easy.


Clojure is an interesting language with deep roots into the history of Lisp. It's not an easy transition though. Really understanding Clojure takes time, patience, and practice. However, I've noticed, that the payoff is typically worth the investment. This is just my experience though, yours may be drastically different.


To your note about the Clojure documentation, it's something the community knows, understands, and is aggressively working toward fixing. You are 100% in the right. The community has made some great strides towards remedying the situation, but we have a lot of work to do.

If you want to help us out, send me a PM! I've written for the Clojure site before and am looking for more reasons to write for them! Send me questions, gripes, rants, concerns, whatever and maybe I can help you out while helping out the Clojure community and the next guy to come along!


Edit: Stop arguing about semantics

2

u/[deleted] Sep 14 '17

I've actually gone through the macro part of Clojure for the Brave and True today so I understand where you're coming from. Though I don't really yet see any use for macros in day-to-day coding, those mainstream languages seem to get along fine without them so far.

But thanks of the explanation!

2

u/[deleted] Sep 14 '17

I was right there with you when I first started, give the talks a shot because macros aren't the only benefit of homoiconic languages! The parens actually turn out to be your friend! :)

6

u/[deleted] Sep 14 '17

I will, Clojure might have a bit of a steep learning curve but I think it'll be worth it, it's even having a positive impact on my non-Clojure code.

3

u/lgstein Sep 14 '17

You won't be disappointed ;)

3

u/unknown-unit Sep 14 '17

Mainstream languages get along fine without macros, but that's not the same as saying they couldn't use them to be better.

Clojure has threading macros for instance, which allow you to write code left to right (or top down in a pipeline form) which would otherwise be inside out. I use this all the time.

E.g. (contrived example)

(filter even? (map inc (reduce conj [] [1 2 3 4 5])))

can be written as

(->> (reduce conj [] [1 2 3 4 5])
     (map inc)
     (filter even?))

A form like that could be provided as a language construct in another language. The point of being able to use a macro, however, is if that if Clojure didn't already have "->>" you could write it yourself quite easily.

Macros are not commonly needed in day to day programming, but I have found uses for them.

2

u/Styx_ Sep 14 '17

Just to tack on to what the other guy said, it seems that the pre-fix syntax of lisps seems to be tied to their ability to simplify syntax well enough to make meta-programming easy.

If you can figure out how to create a programming language that matches the meta-programming abilities of lisp while keeping the "easy-on-the-eyes" syntax of c-descendants, you'll be regarded as a programming god. The fact that it hasn't happened yet suggests that in-fix notation is nearly inherent to easy meta-programming for some reason.

I will note that concatenative languages have come the closest, though none of them have really taken off. You should check out Factor or Forth's syntax some time -- I prefer them to lisps', though the languages themselves while near lisps' capabilities, are not quite there for whatever reason.

1

u/kstarikov Sep 15 '17

How is metaprogramming in Elixir 'profoundly difficult'?

7

u/porthos3 Sep 14 '17

I think you have valid complaints about documentation. I wish it were better too. That said, it is partially made up for by the fact it is so easy to test things out in the repl.

The parentheses, however, is just a lack of experience with the language. I develop in clojure professionally and I very rarely ever end up with more than a few closing parentheses.

That many parentheses indicates you should probably either:

  1. Use threading macros

  2. Make better use of let bindings

  3. Break up your functions to be smaller.

It's essentially the same thing as complaining about the number of closing braces (}) in C or Java.

-12

u/[deleted] Sep 14 '17

In C or Java you don't need to wrap every defn around in parentheses though.

Unless I'm missing something, there shouldn't be any reason in Clojure either.

Just do:

(Defn some_function
    []
    Look at me, I'm indented an so I'm in this function,
    it should be obvious but let's put parentheses anyway)

I'm not saying get rid of all the clojures, but I think at least 50% can be eliminated.

It's not a big deal though, I just think it screws with readability a little bit.

5

u/pihkal Sep 14 '17

C/C++/Java just use lots of {} to delimit blocks and ; to separate statements, though. So it's not as if they have less syntax, just more varied syntax.

Most Lispers never think about parentheses, because we use structural editing modes (like paredit/smartparens). These have commands like "go up an sexp", "remove current outer parens", etc. They have a learning curve, but they make it impossible to miswrite parentheses, short of outside cut-and-paste.

With you on the docs, though, it's a long-standing pain in the community.

-10

u/[deleted] Sep 14 '17

The problem is the human brain has trouble when everything looks too much of the same, it starts to blur together.

It's not a this language versus that language thing, it's a cognitive thing, it just doesn't work with how the brain works.

Anyway I've known about Lisp for a couple of days and I already realise that you love your parentheses and will fight to the death over them.

I'm getting used to them too, it won't be long until I'm part of this insanity.

But I'll say my peace about them while I'm still part human and not a full Lisp-borg.

4

u/goldfather8 Sep 14 '17

You've known lisp for a couple days yet feel qualified to critique it? Further, you are incessantly negative and childish "you guys love your parenthesis... lisp-borg."

For your own good I would introspect and come with a more open mind and patience. Otherwise you will hurt your development and come across as, frankly, an idiot.

-2

u/[deleted] Sep 14 '17

I googled "Borg sense of humour" and got nothing.

Carry on.

4

u/twillisagogo Sep 14 '17

just imagine you are editing json or xml.

4

u/freakhill Sep 14 '17

at some point you'll probably start to like parens more than other kinds of syntax.

4

u/i_am_broccoli Sep 14 '17

Welcome to the amazing world of homoiconic languages with context-free grammars. Its a world where code and data are the same, parsers and interpreters of the language can be written in single sittings, and where you can alter the semantics of the language itself to suit your own needs. Those who stay all suffer a few weeks of syntactic adjustment only to come out the other side with a changed perspective and access to deeper understandings of computation, the lambda calculus, and programming in general. If you stop at the door, contrite with the opinion that the extra parentheses are indicative of a failure of design, never questioning the 'why' of them, I can't help you. It's like you've seen a plane, capable of flight, for the first time and said it's foolish how they've painted those wings red.

3

u/pihkal Sep 14 '17

Ironically, Clojure has fewer parens than Common Lisp or Scheme. We use [] and {} to denote vectors, maps, arguments, etc.

Regardless, Lisp editors auto-indent everything, so I end up relying on indentation to help at a glance.

3

u/Psetmaj Sep 14 '17

You'd probably like to use Parinfer for handling your parentheses. It automatically infers all your ending parentheses based on indent and the like. Depending on your editor, it even darkens all the inferred parens since you don't care about them.

1

u/[deleted] Sep 14 '17

Cheers, I'll try and set it up for Neovim. Though maybe just dimming the colour of the parans might be enough, thanks for the idea.

2

u/ForgetTheHammer Sep 15 '17

Parinfer Indent mode basically makes it the indent language your looking for without losing a lot of other powerful language features you not really appreciating at this stage.

3

u/porthos3 Sep 14 '17 edited Sep 14 '17

I don't see how that is all that different from C or Java.

public void collide (GameEntity a, GameEntity b) {
   a.takeDamage(10);
   b.takeDamage(10);
}

vs.

;I'm using side-effects for sake of discussion
(defn collide [entityA entityB]
  (take-damage entityA 10)
  (take-damage entityB 10))

Often Clojure has the same number of parentheses as Java, they are just around function calls instead of around function arguments.

But that's for equivalent code. Often you can trivially reduce the amount of code using Clojure:

(defn collide [& entities]
  (map #(take-damage % 5) entities))

Same number of parenthese in this case, but it handles any number of entities with the same number of parentheses.

It's not a big deal though, I just think it screws with readability a little bit.

This comes with practice. You'd make similar arguments about syntax unfamiliarity if you learned a lisp first and then went to C syntax.

1

u/[deleted] Sep 14 '17 edited Sep 14 '17

The difference is the top example has 6 "break points" for the eye, or you could call them stop points. It's like how "." and "," and "Capital letter" works when you write English.

  1. character (abcd etc...)

  2. (

  3. ,

  4. {

  5. indentation

  6. ;

While the second example has 2.

  1. [

  2. indentation

All the parans blur together because they happen so much. A "break point" is anything that the brain hasn't seen for a while, so it pauses when it occurs and it can thus chunk segments for easier comprehension.

Also in the second example you're trying to read "take-damage" but you see (take-damage, and you don't know how to pronounce (, so the brain sort of glitches for a moment until it can filter it out.

I'm guessing the more you use Lisp the more the brain gets used to filtering the parans, like it would filter noises from a noisy neighbour. But you can never quite fully get rid of the noise.

You're probably used to the parans, so let's try something your brain hasn't learnt to filter yet:

/defn collide [entityA entityB]
  /take-damage entityA 10/
  /take-damage entityB 10//

Notice how your eye keeps jumping back to the slashes while you're trying to read.

3

u/ForgetTheHammer Sep 15 '17 edited Sep 15 '17
(defn collide 
  [&, entities]
  (map 
      #(take-damage % 5) 
   entities))

Now it has more " breakpoints" to. Feel free to format your code accordingly, though i can't say the comma really helps me personally.

1

u/[deleted] Sep 15 '17

That's actually a lot better.

4

u/porthos3 Sep 14 '17

My eyes don't jump to the slashes at all. Like I said, I think it's just a matter of what you are most used to.

I'd argue that if you have no experience with either syntax, C syntax is a lot more confusing. I can explain lisp syntax to a programming beginner in a sentence and have them understand it perfectly.

1

u/eggsyntax Sep 16 '17 edited Sep 16 '17

I'm guessing the more you use Lisp the more the brain gets used to filtering the parans, like it would filter noises from a noisy neighbour. But you can never quite fully get rid of the noise.

I'm not saying anything very different from what other folks have said, but I want to point something out: you're saying you can never get rid of the noise, but you don't have any way of knowing that yet. Notice that what the experienced Clojure programmers are saying is "I prefer the parens, I wouldn't want it any other way." If it were like a noisy neighbor, people might be saying, "oh, it doesn't bother me much anymore, I barely notice it." But they wouldn't be saying that they highly value the parens and would hate for them to go away. It might be worth being open to the possibility that you're mistaken, instead of being certain already that it'll always be a negative.

Your example with the slashes is great! My eye does trip over them. But since they're equivalent to parens (or would be if there were distinct opening and closing versions), I feel confident that I'd learn to love them too. The important thing isn't the particular character, it's that wrapping the entire statement in delimiters (aka S-expressions) turns out to be awesome :)

I very much hope that, if you stick with it, you'll come back in six months or so and let us know what you think then. I'd be really interested to find out.

7

u/moxaj Sep 14 '17

Re parens:

  1. As others have pointed out, clojure has roughly the same number of parens/brackets/braces as say java (it also improves upon other lisps by introducing literals for vectors, maps, etc.)

  2. After a while, you'll pretty much ignore parens and focus on indentation, just like in Python. Moreover, if you use a tool like Parinfer (which I highly recommend), parens are automatically handled for you, as long as you take care of indentation. So essentially it's like Python with some additional benefits.

About the docs: you are right, they are pretty bad for newcomers. See this talk.

3

u/[deleted] Sep 14 '17

Great talk.

6

u/_chrm Sep 14 '17

The simple syntax with all the parentheses is what makes Lisp Lisp. Do you know what a syntax tree is? In other languages you have to remember all the different syntax rules to write source code. The source code then gets compiled into a syntax tree. In Lisp your source code is the syntax tree! The parentheses are the best way to represent it.

That makes it possible to write a different kind of function, a macro, that operates on the syntax tree. If you start to include more syntax rules you lose that.

1

u/[deleted] Sep 14 '17

I'm just annoyed that one of the most frequently entered symbol requires a modifier on an typical keyboard. Should have used [ ] instead, putting what currently use those to work with parens.

But I realize that call was made far far back in the days of the first LISPs and is unlikely to change...

1

u/ws-ilazki Sep 15 '17

I'm just annoyed that one of the most frequently entered symbol requires a modifier on an typical keyboard. Should have used [ ] instead, putting what currently use those to work with parens.

The same thing could be said for any language using { }, though I do somewhat agree. I've come to prefer algol-ish do ... end type blocks (like Lua or Ruby) to the C-style { } for that reason. Parens don't bother me quite as much, though. Perhaps because they see more use in normal writing as well, so it doesn't feel as alien as the curly braces.

If you really want to abandon everything but [ ], try out Rebol or Red; they're homoiconic, like lisps, but using square brackets instead of parentheses.

Or you can use Racket, which treats [ ], { }, and ( ) interchangeably. This, for example:

[define [partial f . a]
  [lambda l [apply f [append a l]]]]

[define inc [partial + 1]]

[inc 41]

is valid (albeit un-idiomatic) Racket.

0

u/WikiTextBot Sep 15 '17

Rebol

Rebol ( REB-əl; historically REBOL) is a cross-platform data exchange language and a multi-paradigm dynamic programming language designed by Carl Sassenrath for network communications and distributed computing. It introduces the concept of dialecting: small, optimized, domain-specific languages for code and data, which is also the most notable property of the language according to its designer Carl Sassenrath:

Although it can be used for programming, writing functions, and performing processes, its greatest strength is the ability to easily create domain-specific languages or dialects

Douglas Crockford, known for his involvement in the development of JavaScript, has described Rebol as "a more modern language, but with some very similar ideas to Lisp, in that it's all built upon a representation of data which is then executable as programs" and as one of JSON's influences.

Originally, the language and its official implementation were proprietary and closed source, developed by REBOL Technologies. Following discussion with Lawrence Rosen, the Rebol version 3 interpreter was released under the Apache 2.0 license on December 12, 2012.


Red (programming language)

Red is a computer programming language. Red was made to overcome the limitations of the programming language Rebol. Introduced in 2011 by Nenad Rakocevic, Red is both an imperative and functional programming language. Its syntax and general usage overlaps that of the interpreted Rebol language (which was introduced in 1997).


[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source ] Downvote to remove | v0.27

1

u/eggsyntax Sep 16 '17

I remap my command or control keys to give me open and close parens (when pushed alone, not with another key). Highly recommend it :)

1

u/Michaelmrose Sep 14 '17

Indentation is implicit but parens are explicit. It makes the structure obvious especially with a plugin that colors sets of parens differently and or highlights the end paren of the current structure.

It would also make code that manipulates the structure harder. You would obviously need some way to denote structure within the same line. Do you just spread the whole deal out over more lines or use a different character to denote structures within and between lines?

Your objections are old news and they were poorly thought out decades ago.

0

u/[deleted] Sep 15 '17

[deleted]

-1

u/[deleted] Sep 15 '17

Wasn't there something on reddit as well, something like; if you want the right answer, just post the wrong one.