This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-21
Channels
- # 100-days-of-code (5)
- # announcements (6)
- # beginners (92)
- # cider (39)
- # cljdoc (35)
- # cljsrn (1)
- # clojure (187)
- # clojure-sanfrancisco (2)
- # clojure-spec (26)
- # clojure-sweden (2)
- # clojure-uk (1)
- # clojurescript (27)
- # cursive (19)
- # datascript (3)
- # datomic (19)
- # defnpodcast (1)
- # emacs (11)
- # fulcro (71)
- # incanter (1)
- # lein-figwheel (4)
- # lumo (10)
- # off-topic (19)
- # planck (5)
- # reagent (49)
- # reitit (2)
- # shadow-cljs (25)
- # spacemacs (1)
- # sql (1)
- # unrepl (4)
- # yada (4)
What are some thoughts between Clojure and Racket? Do you like them both? Do you prefer one over the other? Why?
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!
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.
@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.
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?
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.
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
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
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
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
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
> 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?
it's a repo but in the book its a tarball. https://github.com/flyingmachine/emacs-for-clojure
yeah, book points to https://www.nostarch.com/clojure 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
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
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
admittedly, I have limited success with that. but i'd rather have someone who tries than someone who never does
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
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
@porkostomus Great insight! I’m playing with spacemacs and using that guide myself. How was the transition from Racket to Clojure?
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
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
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?
Pretty sure I’d be in the same boat as @coinedtalk
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
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?
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
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
self-installers
something you click and get started right away
on windows its kind of a pilgrimage sometimes to get it to work
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.
Though http://nightcoders.net seems really cool
imho, also beginners should get started out with parinfer and bracket highlighting
because most people are put off by the lisp syntax obviously
I had come from learning to do webapps on http://pythonanywhere.com, so that was like the Clojure version of that
Maybe something like 'recommendations' on the clojure page where its visible
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)
but yeah. something like links to the protorepl guy's gist, which made setup a "follow the bouncing ball"
I’ve been playing with maria.cloud. 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 the Clojure community defines a beginner differently than something else like Python
in Python it's assumed that you are a semi-sentient ape that has managed to obtain a computer
somehow
and MAYBE can do multiplication
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)
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
If there's any doubt that Clojure can be a great first language, you need to see Power Turtle http://timothypratley.github.io/power-turtle/
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
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.
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.
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?
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
there is no way to underestimate how low the entry level can go
we're all just used to it
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
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
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
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
yeah you just can't do any server side code
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
number precision is really weird (like js)
regexes are different
https://clojurescript.org/about/differences 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?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
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 https://choosealicense.com/licenses/ ? 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
Ok it is easy to find them by github search license:epl-2.0
https://github.com/eclipse/che/blob/master/LICENSE thx
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?
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.
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