Fork me on GitHub
eccentric J01:10:13

What are some thoughts between Clojure and Racket? Do you like them both? Do you prefer one over the other? Why?


Racket has cool macros and documentation and stuff. Clojure pays my bills :)


and that seems glib but i mean it as a sincere compliment. Clojure is a neat fun language that actually pays the bills


i get to work in it monday through friday and not just as a hobby language on the weekends. Racket has some really great things. TCO, the syntax pattern matching, continuations, creating languages. But Clojure has some great things and i get to do it professionally.


Yeah I'm right there with you on that. Clojure is a great language to work in and I'm happy that's my job. Racket is fascinating and a great tool for learning and experimentation -- and I've really enjoyed using it on two online courses.


which two online courses use racket?


Programming Languages -- University of Washington. An Introduction to Systematic Program design -- Gregor Kisczales


Ah thanks! Programming Languages was definitely a great course!

eccentric J02:10:04

Ah cool, I’ve been playing with it slightly. Considering recommending it to a coworker to start their programming journey with. I would love to recommend Clojure but it strikes me as a bit intense for a first language.


Any recommendations for someone picking up Clojure?


@jayzawrotny I like the Clojure for the Brave and True book


Brave and True, or Living Clojure. @sieabah


@jayzawrotny ClojureBridge has shown that you can teach Clojure as a first language successfully.

eccentric J05:10:38

Huh really? I’m working through Brave and True myself. It’s very good but I can’t help but feel emacs + cider is a beast to learn even with a lot of programming experience. Not to mention that Clojure runs on Java, and Java has a complicated installation and licensing process plus errors are not user friendly. With Racket just download Dr Racket, run it, and you’re good to go at least for a while. Learning Clojure has been a lot of choices: Java 8 or Java 9? Lein, Boot or deps.edn? Vim, Emacs, Atom, Cursive, or Calva? Clojure or ClojureScript?

eccentric J05:10:38

ClojureBridge is a workshop right? In that context I’m sure learning Clojure as a first language is doable. However, with someone trying to teach themselves I think they would find a lot more friction from Clojure compared to Racket. That said I see more value in Clojure but I think Racket would be a great way to focus on the concepts of LISP and FP before making the switch to Clojure.


i picked up lisp way back in the day as my second language after basic. without the baggage of other languages, i found it quite simple. years later when i went back to it, it was more difficult since I'd been OO'd into the ground. I look at clojure as lisp with access to the java standard libs in case of emergency.

eccentric J05:10:15

Agreed. The Java or JS layer underneath is a huge win for businesses and paid professionals. Which is a major reason why I believe Clojure should be the end-game if starting with Racket.


I'm a sysadmin. My use for it is I make a simple little tool to do something like pop a server from rotation. jar it up, give it to the release engineers. super duper simple, and all the system needs is the jdk and my .m2 to run it (systems don't have interwebs). so my use case is different from developers, but if people aree leaning towards the dark side of having root, it's a great tool to build automation for simple sysadminy tasks.


i was almost forced to go functional to isolate the side effects of interacting with the system via the system tools

eccentric J05:10:49

Fair point, changing my wording from developers -> professionals.

eccentric J05:10:19

Was Clojure your first language?


basic, then elisp, then C, it goes from there. but I don't have the mindset to be a good developer. so my mastery is very little in any of them. but then, i started back in the 90's. first professional job was migrating C++ to Java systems, with a brief stopover in visual basic when the business bought into NT 4.0's microsoft transaction server. back before java was considered production ready. those were bad times.


i'd stand up the servers, libraries, middleware, and then work with the devs to shoehorn it all in

eccentric J06:10:20

That’s some history 🙂 In which case I’m betting learning Clojure was probably pretty comfortable to get started with given your Java experience. I’m curious how it would go for someone who isn’t acquainted with the tech industry learning Clojure or Racket.


clojure was a great discovery. "lisp that runs on the jvm". i immediately dropped groovy and ported my scripts.


There is no need to learn Emacs+Cider to use Clojure effectively, I don't think. Throwing that at a beginner who had not used Emacs before, when also learning Clojure, does seem a bit much.


teaching beginning sysadmins the "automate all the things" starts with shell, then they hit the need to backslash x 6 to get that sed to work and I expand into other languages. pain is a great teacher. luckily we have intelliJ at work as a standard install. no need to try and teach emacs

eccentric J06:10:54

You’re correct you don’t have to, but that is what The Brave and True book recommends. If you’ve never worked with a code editor before will you be aware of the alternatives? Will working with emacs, even minimally to get through the book feel good or create a lot of friction?


20 years ago you couldn't pry emacs from my cold dead fingers. but even I couldn't quite get it working properly from the book. again, different perspective. i tried, skipped, and went with atom and protorepl, which was 2 hours to install and worked like a champ


'cause i'm too cheap to buy cursive at home


the setup for brave is incredibly old and recommends a 3 year old version of CIDER. it also gives an emacs init to use but it includes compiled elc files which cause pain when upgrading. it needs to be modernized badly


that was exactly my problem


> Dec 21, 2014 that's the release date of CIDER it recommends. and yeah the elc files in a repo are just bad


Is Brave and True setup instructions in something like a Github repo that others can contribute to easily?


tarball from the publisher site, i think


lemmie look. i have the book right here


yeah, book points to where you download a zip and move it into your emacs.d


i must say though, that book completely trivialized the initial lein learning curve, which is all i need to do to get people hooked


once they see something build into a self-executing jar, the imagination goes wild

eccentric J06:10:27

Did those people have prior programming or tech industry experience?


usually beginning sysadmins. so bash, sed, awk, and some perl is the extent


we snatch them up from the operations center if they show promise after 18 months or so of seasoning themselves


what with the work they do, i'm sure there's some php in there. patching and fixing wordpress modules from instructions

eccentric J06:10:19

Oof that takes me back


but a good crash introduction into the kinds of stuff we'll be doing as sysadmins. and it shows the people who instinctively think "wouldn't this be easier if..." and then the initiative to try it. when it breaks, we get involved and that's how we know


and then try to train the cowboy out of them


admittedly, I have limited success with that. but i'd rather have someone who tries than someone who never does

Bobbi Towers06:10:38

Clojure is my first language. Well, I did a little Racket before (reading How to Design Programs) but then hit a wall as far as being able to like, make stuff. Clojure Brave got me to learn emacs, but if you want a nice Cider setup quick, I recommend the Practicalli spacemacs guide


sysadmins. training civilized monsters


i honestly don't want to get sucked back into emacs. i know how addictive it is, but I don't have it everywhere, and our devs use intelliJ. gotta speak the language of the people

eccentric J06:10:40

@porkostomus Great insight! I’m playing with spacemacs and using that guide myself. How was the transition from Racket to Clojure?

Bobbi Towers06:10:25

I didn't learn Racket hardly at all, because once I found Clojure I was immediately sold. Except the first time I tried it I couldn't actually get it to work. Didn't even know about Leiningen

eccentric J06:10:37

Interesting, what made you come back and get it to work?

Bobbi Towers06:10:03

What finally made it click was when I found the Heroku tutorial, the "Shouter" app. In fact, I keep coming back to that one


I think if I didn't know Python and Javascript before, I wouldn't have been able to learn Clojure tbh

Bobbi Towers06:10:47

I find this topic quite interesting, because it puzzles me when I hear stuff like that


i've had to spend some time explaining things like stacks to people. or, even more basically, the way machine instructions are processed. having a mentor helps immensely getting over the initial learning hurdles


did you have someone to bounce questions off of, @porkostomus?

eccentric J06:10:17

Pretty sure I’d be in the same boat as @coinedtalk

Bobbi Towers06:10:52

not at all, I was completely on my own just reading docs


yeah, you're the outlier then. initially i learned from my mom, and then from the guys in my dorm. these days, the languages all smoosh together

Bobbi Towers06:10:48

I had done a bit of Python and JS before that, and actually found them much harder.


I find them more difficult now too, but not the first few months


for example: "this is how you would implement a for loop in Clojure" but if you don't know what a for loop is...


or Brave Clojure which immediately starts scaring you with recursive functions


🙂 there's definitely a brain twist involved in that if you haven't done assembler. people tend to think linearly. even if they don't act so in their lives


or basic, even. it's been a while, but that was all gotos. and we planned it out on paper in the computer lab


so, this is interesting. it will help train the new folk. what is the best way to get people to think recursively?

Bobbi Towers06:10:24

when you start to "get" Clojure, there's a point when you realize the immense power that is in your hands, and that excited me so much that it was like getting struck by lightning. Suddenly I was on fire


seriously. it's been 25 years and i STILL remember when i got it and the little dungeon game i was working on started building itself

eccentric J06:10:35

That’s what inspired me to try and find the best LISPy FP language to recommend to absolute beginners. Previously, I had recommended Python just since it’s so common and fairly easy to get started with but I think Clojure or Racket are simpler. I just think to a less tech savvy beginner Racket is going to allow them to focus more on the problems of designing their programs versus the tooling to get started.


if it's a tooling problem, what's the best way to get the tools into people's hands? I have a VM image that I give to my folk




something you click and get started right away


on windows its kind of a pilgrimage sometimes to get it to work

eccentric J06:10:07

That makes sense in your field McPhee. In my case a former event planner has expressed interest in learning programming. I’m not sure Clojure is going to be accessible enough to them out of the gate.


agreed. i'd like to get a simpler system. and yeah, taking a good look at nightcoders


imho, also beginners should get started out with parinfer and bracket highlighting


because most people are put off by the lisp syntax obviously

Bobbi Towers06:10:53

I had come from learning to do webapps on, so that was like the Clojure version of that

eccentric J06:10:39

Agreed with parinfer and bracket highlighting.




Maybe something like 'recommendations' on the clojure page where its visible

Bobbi Towers06:10:07

those things actually annoyed the crap out of me, because I always loved the parens


'among other tools, our community likes to use: ... "


it's the language. the standard code blocks are too small to do normal indented parens (or braces in other languages)


How about

👍 4

but yeah. something like links to the protorepl guy's gist, which made setup a "follow the bouncing ball"

eccentric J07:10:02

I’ve been playing with I was going through some of the lessons from Clojure Brave and True but hit a wall when some code doesn’t work and I find out it’s because it runs ClojureScript instead of Clojure. Not that it’s a deal breaker, just depends what level of a beginner they are.


I think having a quick guide for the more visually inclined is a good thing for sure


I think the Clojure community defines a beginner differently than something else like Python

💯 4

in Python it's assumed that you are a semi-sentient ape that has managed to obtain a computer


and MAYBE can do multiplication

Bobbi Towers07:10:45

yeah, it's similar to Racket's "picture language" in "How to Design Programs"


considering how often I resort to the whiteboard and draw boxes with arrows, there's definitely utility in it


I wonder if you could represent clojure programs like Pd (Puredata)


badly. pictures don't do recursion well past the first few looping arrows


just look at those videos on "teaching you monads". it's such a simple concept if you know math past algebra, but we still find ourselves overcomplicating them

Bobbi Towers07:10:32

If there's any doubt that Clojure can be a great first language, you need to see Power Turtle

eccentric J07:10:22

This is awesome but it hasn’t erased my doubt yet.


I think it's a good first language because the syntax is small, the core language is small, symbols are first class.


there's a problem in that if you try to explain it up front. i wait for people to ask "but what if I want * to be something else?" in most languages the answer is "tough luck". and people accept it.


additionally the repl approach makes it so much more playful, and experimenting is key to learning new stuff


would a vim-adventures approach work? a tutorial where you have to unlock functions based on mastery of the previous ones?


I'm not sure that works with a full language or not. as a way to learn a tool, it works

eccentric J07:10:10

Actually, I take that back. I’m sure Clojure can be a great first language but there’s lot of specifics that need to be abstracted or hidden from beginners. With Racket you can give them a full language, PDE, REPL, and graphics environment within minutes just from downloading DrRacket.


I think Racket is a great choice too, I don't know if you really need to abstract or hide that much with Clojure though.

eccentric J07:10:54

Well, depends where they’re coming from I think. If they have at least tech experience installing Java, Lein, a code editor, and a repl\clojure plugin isn’t a big deal but for an OS X user who doesn’t even have homebrew I see potential for all that to become a pretty steep hill.


Ecosystem install friendliness has come a long way recently, but I'm sure it could be better.

eccentric J07:10:44

That’s true, it is getting better.


my people are comfy on the CLI and frustrated with restricted languages like the puppet PDL, but are entirely comfortable building complex toolschains. do devs fall into the same camp?

eccentric J07:10:20

I think so, I’m sure there are exceptions but I bet majority feel pretty comfy with CLIs.


but i've seen hesitation from our project manager types to even look at a terminal. they want the web browser or MS Word experience

👆 4

there is no way to underestimate how low the entry level can go


we're all just used to it


true, but if they're on a computer asking questions we can make some base assumptions


guitar players are always shocked when people do something like put multiple fingers on one string, because to them that possibility didn't even exist


there's nothing wrong with doing the full IDE route. I'm wondering if the two approaches are mutually exclusive, or at least not worth the costs in lost functionality

eccentric J07:10:48

Is a project manager considered a developer?


I don't think the language itself should be changed


nah, but they hang out with 'em every day. and occassionally want to poke and see if they can do it too


yep every project manager I know is now on a python trip


plus, never underestimate the complexity of creating JIRA workflows and those weird charts. that's programming, no two ways about it


so, with python, it's "install this .msi then run python in your cmd", or do the PMs have a different way of getting their feet wet?


i know my thinking always reverts back to package installs and CLI. so my questions may seem obvious. sorry about that

eccentric J07:10:58

All good, I share your curiosity


well, the nightcoders editor is absolutely fabulous. but it will need some tutorial stuff and import functions to give to beginners.


i mean, "go to this URL, sign in with google, and click this button" is right up the alley of the PM types

Bobbi Towers07:10:52

It's cool because you can do games and music projects, and it leads naturally into his other project LightMod, which gives you some great templates for Reagent, Rum, H2 Database, and a Sente chat app


and the ability to build an internal one will assuage some of the business folk. that's extremely generous of the devs


i mean, that editor is REALLY good. it has all the features i spent an hour making work in atom


is it a fully functional closurescript environment? i see library importing, but curious if it's out of the box fully geared

Bobbi Towers07:10:40

yeah you just can't do any server side code

Bobbi Towers07:10:09

for that you need LightMod


ahh, that would explain it. was trying to get it to plug into my f5 ltm 🙂 simply some code i know


well, there's your full stack. i can do all my things in it. not comfy, i need my tools, but simple stuff is completely doable


wondering whether CLJS is more approachable


it would probably be for people who's experience is with apps and browsers and not dev environments


it's easier to convince someone to try something if they're working in a comfortable space


i know nothing of the language, though. what are the oddities, etc


number precision is really weird (like js)


regexes are different

deliciousowl08:10:45 few other gotchas but those are the ones that tripped me up


huh. i think i could work within these limitations. the question is, will it throw off someone first coming to it


the joy of writing type checking code to deal with dynamic typing is why I don't recommend python to new programmers anymore


i mean, let's be clear, you must always check your inputs, etc. but for someone first dipping their toes in, you don't want to drown them in a checklist of rules


well, that's a whole other discussion, though. because i have an end-goal of what i want folk to do.


hello! I'm trying to define my first "usable" macro and I am hoping to get some help here. This is the macro, which is supposed to define a curried function, like haskell does it by default.

(defmacro defcurry [name fn-to-call & args]
  `(defn ~name [args]
     (partial (apply ~fn-to-call args))))
My expectation is now to define curried functions in the following fashion:
(defcurry print-hello println "hello") 
Calling the print-hello function would always print hello, in addition to any other argument
(print-hello "world")
;; hello world
The problem is that the above defcurry definition does not work:
clojure.lang.ExceptionInfo: Call to clojure.core/defn did not conform to spec:
                                         In: [1 0] val: trainer.html/args fails spec: :clojure.core.specs.alpha/arg-list at: [:args :bs :arity-n :bodies :args] predicate: vector?
                                         In: [1 0] val: (trainer.html/args) fails spec: :clojure.core.specs.alpha/arg-list at: [:args :bs :arity-1 :args] predicate: (cat :args (* :clojure.core.specs.alpha/binding-form) :varargs (? (cat :amp #{(quote &)} :form :clojure.core.specs.alpha/binding-form)))
... and so on. However, the macroexpansion of the defcurry definition looks right:
(defn print-hello [args] (partial (apply println args))) ;; after calling cider-macroexpand-1 on the `(defcurry ...)` above
Can someone help me? What am I doing wrong?


in your macro you call apply. that seems to be what you want to happen later


a little bit more clearly. apply does not return a function. so "partialing" the result of apply doesn't seem beneficial


@lsund also, that macroexpansion does not look right, maybe cider hides the namespaces automatically?


in the error message, you can see the problem: your args argument is qualified to trainer.html/args


also, there's 2 args in your example


You are right, this does not look right. It was maybe premature to post it here. I'll look in to it and get back to you. Thank you for the pointers!


I am trying to understand licences. I want to publish library. Why EPL is not here ? I am looking simple explanation to understand comparison MIT vs EPL. I guess I should choose between them. There is a lot of articles about licences, but on the end I don’t understand how to choose. Somebody already learned it and can share his thoughts?


Click on the "appendix" link of that page to see info about more licenses


I don’t know any with eclipse public license 2.0


Ok it is easy to find them by github search license:epl-2.0 thx


> Patent use What this point is about?


All of the column titles in the table are clickable to take you to a brief description below.


If a software license does not mention patents at all, it leaves projects that use it open to the possibility that someone may contribute code that obeys the license, but intentionally violates a patent that the contributor owns, so a malicious entity could cause legal trouble for the project.


If the software license explicitly says that all contributors grant any and all patent licenses required to use the contribution, the project should be able to avoid that possibility.


So MIT vs EPL EPL has “patent use” protection and force to keep source open. Is it right summary? Thank you for explanation.


“disclose source” is only about repository (library)? Not code which use this library as a dependency?


So what developers have to do to use my library? Can they use it and don’t care? Because library is on github so source in available?


Any risk for them about be forced to public source code of they app?


If you want actual legal answers, an intellectual property attorney is best (and unlikely to be free). That and reading the actual agreements and commentary about them that can probably be found on line (more often by non-lawyers than lawyers). The summary table on that page is intentionally brief, to quickly compare the major aspects of many licenses.


As far as I have ever heard, you can take GPL'd source code, make modifications to it, run it on your own computers, and as long as you never give the binaries to anyone, you are not legally obligated to give them source code. You can even run it on a web server that you own or control, and let people interact with it, and not be legally obligated to distribute your modified source code.


If you want to distribute the compiled executable code to other people, though, then the GPL requires you to give them source code if they ask for it. Most people choose simply to publish the source code in a public Internet place, rather than responding to personal requests.


My quick reading of the EPL seems to imply that you can distribute binaries of the code, or other code linked with it to make a larger system, without releasing the source code of the parts they added. If they choose to release source code of a modified version of something they received under the EPL, they must do so under the EPL.


Well in my experience lawyer has to specialise in licenses to trust his answer. I don’t know anybody with this specialisation. That is why I am looking answer here 🙂 Oh so it is even possible to do SaaS with it. Interesting. > give them source code if they ask for it Code of the library or code of the full app which use this library? So please if we can make it clear: EPL license. Can developers use library as dependency without risk to be forced to share code of the app when they distribute binaries? Even mention about this dependency in agreement.


It is my understanding that with many licenses, such as EPL, Apache, MIT, and BSD, anyone can take code released under any of those licenses, incorporate it as part of a closed source project, and release binaries, with no obligation to release any source code at all, even if there are modifications they made to the parts of the software covered under those licenses.


If you rely on this information and are sued, I am not liable 🙂


The above is definitely not true for code released under GPLv2 or GPLv3


I believe it is mostly the case for code released under LGPL (the Library GPL), except that if you distribute binaries of code created from modified versions of LGPL code, you must offer source code of the changes made to the code released under the LGPL, but not any other code it is linked with.


> If you rely on this information and are sued, I am not liable haha sure 🙂


thank you. Seriously 🍻


Is somebody using transit in their API? Is it based on the Accept header? I am thinking of accepting application/transit+json similar to application/hal+json but wanted to ask around first