notjack
2017-11-20 08:20:57

@samth racket -l tests/racket/test now works in docker! (the problem was some tests didn’t work when run as root, and docker runs the container entrypoint process as root and PID 0 by default)


notjack
2017-11-20 08:35:23

slack1
2017-11-20 15:14:25

Does anyone know why compose takes arguments in reverse order?


abmclin
2017-11-20 17:58:28

@slack1 my guess is it’s because it’s standard mathematical composition order. Given functions f g and h composed as g(h(f(x))) in standard mathematical notation. It is always evaluated inside out so using Racket’s compose you’d write it as (compose g h f)


leafac
2017-11-20 18:33:35

I don’t think of it as “reverse order,” but as “let’s move some parentheses around:”

> (displayln (add1 0))
1
> ((compose displayln add1) 0)
1

Note how displayln and add1 are in the same order in both.

Maybe this intuition helps you too.


slack1
2017-11-20 18:33:58

I see now


slack1
2017-11-20 18:36:02

though intuitively, I still feel like it’s natural to think from inner to outer


slack1
2017-11-20 18:36:07

as A -> B -> C


ben
2017-11-20 18:36:42

there might be a library for that (“diagram order”), but I can’t find it right now


leafac
2017-11-20 19:11:03

@slack1 It’s not exactly compose, but you might be interested in threading macros: https://docs.racket-lang.org/threading/index.html


slack1
2017-11-20 19:28:45

mmm very interesting


abmclin
2017-11-20 19:43:47

maybe you can try writing a new function compose* that takes arguments in a more “intuitive” order, it’ll be fairly easy to write.


slack1
2017-11-20 22:49:56

Now I think I understand some of the funny arrows I’ve seen in Clojure


lexi.lambda
2017-11-20 22:51:00

@ben, @slack1: @notjack’s point-free package provides a flipped version of compose


slack1
2017-11-20 23:04:20

Ah I think the threading library has funny interactions with lambdas -_-a


lexi.lambda
2017-11-20 23:05:06

@slack1 if you want a real function, use point-free, not threading


lexi.lambda
2017-11-20 23:05:18

threading is a macro.


notjack
2017-11-20 23:06:06

what lexi said


notjack
2017-11-20 23:06:36

if you want a real function but also want the pretty underscore chaining syntax, use the thrush function from point-free combined with the fancy-app package for pretty lambdas


notjack
2017-11-20 23:06:55

actually whoops


notjack
2017-11-20 23:06:59

thrush+ is for that


lexi.lambda
2017-11-20 23:07:01

if you want to thread into a lambda with threading, wrap it in extra parens, e.g. (~> 3 ((lambda (x) (+ x 2))))


notjack
2017-11-20 23:07:06

thrush is the reversed version of compose


slack1
2017-11-20 23:07:25

ohhh I see


notjack
2017-11-20 23:07:42

(thrush f g h) == (compose h g f)


notjack
2017-11-20 23:08:09

(thrush+ x f g h) == ((thrush f g h) x)


slack1
2017-11-20 23:08:13

But am I wrong in saying that threading is like an official library of Racket, and thrush is someone’s personal library on Github?


lexi.lambda
2017-11-20 23:08:31

no, threading is my library; it isn’t official.


notjack
2017-11-20 23:08:45

that would be correct; also thrush is part of point-free which is my library


notjack
2017-11-20 23:09:14

fwiw both lexi and I also work on standard racket libs so we’re not entirely inexperienced :)


lexi.lambda
2017-11-20 23:09:27

speak for yourself :)


slack1
2017-11-20 23:09:38

ohh whoaa I see


notjack
2017-11-20 23:09:39

im pretty sure I’ve seem at least some commits from you to stuff in the main dist


notjack
2017-11-20 23:09:54

then again, my memory is not so good


lexi.lambda
2017-11-20 23:10:40

yes, I’m just teasing re: “not entirely inexperienced”


ben
2017-11-20 23:10:56

why is it called thrush?


lexi.lambda
2017-11-20 23:11:03

birds


notjack
2017-11-20 23:11:05

birds


ben
2017-11-20 23:11:10

??????


notjack
2017-11-20 23:11:13

Birds


slack1
2017-11-20 23:11:26

Ah a songbird


lexi.lambda
2017-11-20 23:11:29

there’s a book called To Mock a Mockingbird that’s about the combinator calculus


lexi.lambda
2017-11-20 23:11:38

and it assigns bird names to a bunch of combinators


ben
2017-11-20 23:11:43

lol


ben
2017-11-20 23:11:48

I’m only on the barbers chapter




notjack
2017-11-20 23:12:40

looking back, calling it thrush in the point-free package is more “cute” than “useful”…


slack1
2017-11-20 23:51:42

I thought it was a technical term I never heard of hehe


slack1
2017-11-20 23:51:52

Something from the deep lore of category theory


notjack
2017-11-20 23:56:11

in your defense, the bird combinators are pretty related to category theory


lexi.lambda
2017-11-21 00:00:38

err, *unrelated?


lexi.lambda
2017-11-21 00:00:56

I don’t think the bird combinators are very related to category theory


notjack
2017-11-21 00:08:52

They’re compositional patterns for morphisms. At least, I think I remember reading something forever ago claiming the two were related and that thinking about their relationship is useful. I don’t exactly do much category theory…


lexi.lambda
2017-11-21 00:13:31

oh, maybe… but then again, everything is related to category theory if you try hard enough. they definitely don’t come from category theory.


notjack
2017-11-21 00:13:41

oh definitely


edwardsayer
2017-11-21 00:16:06

@edwardsayer has joined the channel


nickr500
2017-11-21 01:10:31

@nickr500 has joined the channel


dustin
2017-11-21 03:24:29

@lexi.lambda I respect your opinions because you have so much experience programming. But I’ll tell you what. I’ve been trying to learn Haskell as my first real programming language, and it’s been extremely tough. Would you say as someone who’s learned Racket, Haskell, and probably many other languages, that I’m making a reasonable decision? I’ve talked to a ton of people in the Lisp and FP world—everyone has their opinions. That alone is perhaps more fascinating than actual programming. Perhaps there’s no true one road or way to learn, but I’m open to opinions. Some people tell me learning Haskell is easy with the right tools. I’ve yet to see anyone learn it easily—or probably any language for that matter.


dustin
2017-11-21 03:32:25

I love Racket as a language, but I feel like if I want to make money doing this, it may not be the right decision. Then I think—if I invest so much of myself into one language, will I have the same bias? At that point, I suppose I’d have to think my way out familiarity. I realize Racket is an educational/academic language—well—sort of like Haskell (don’t say that to Haskellers!), but I suppose it’s interesting some of the most advanced languages originated as academic languages or remain so.


lexi.lambda
2017-11-21 03:44:47

I would not personally recommend learning Haskell as your first language


notjack
2017-11-21 04:05:10

@dustin do you want to pick up an “industry” language that’s slightly functional-ish and easy to get jobs with or a language that’s much more functional and you have an alright chance at getting a job with if you’re in the right area?


notjack
2017-11-21 04:05:55

for the latter, I think clojure’s got a shallower learning curve than haskell while still seeing much more industry use than racket


dustin
2017-11-21 04:06:42

Here’s a better question. What path would you take knowing what you know now? I’m going to guess you’d say Racket; I could be wrong. But one of the nicer things about Racket, I think, is the documentation, and how you can create a language of your own. I’ve also thought about learning JavaScript well enough and then moving onto PureScript. But then, I get a bunch of other varying opinions. Some feel learning PureScript is doable—others think you need some other FP experience. I feel like Haskell is so minimal and foreign, it’s hard to grasp because of that. PureScript is probably similar in that regard. Elm makes it easier, but then I get the feeling of using something dumbed-down.


jaz
2017-11-21 04:09:36

For a first language, it’s a good idea to use a simple language. You’re trying to learn how to program, not how to use this particular brand of hammer.


jaz
2017-11-21 04:10:27

(This is why the HTDP course doesn’t use Racket as its language but, instead, languages designed specifically for teaching.)


dustin
2017-11-21 04:12:02

@notjack that’s a really great question. I’ve thought about Clojure, but when you say shallower, what sort of resources are available? I’ve only somewhat researched Clojure. Most of my efforts are shattered after talking to a few Haskellers.


lexi.lambda
2017-11-21 04:12:55

if you’re learning to program, I second @jaz and recommend How to Design Programs and its teaching languages.


dustin
2017-11-21 04:15:22

Alright, thanks. I realize a lot of this stuff is subjective, but I do like how friendly and less opinionated the Racket community is.


notjack
2017-11-21 04:28:44

@dustin I’m not super experienced with clojure so I don’t know. My limited experience did find the docs for most of clojure very lacking, especially when compared to racket’s docs


notjack
2017-11-21 04:30:28

but @jaz is right, racket is probably the best way to go if you’re looking to first learn programming, especially structured programming on projects that are more than just toys


jaz
2017-11-21 04:34:29

You’ll find, eventually, that learning a particular language is easy. The important stuff that you learn while working with one language will (mostly) transfer over to another. There are some things, though, that you’ll only learn from exposure to multiple languages. You know this already, of course, but, for example, if you only work with untyped languages, you may find type systems hard to grasp.


jaz
2017-11-21 04:35:30

A great deal of the complexity that you find in languages has little to do with good programming.


dustin
2017-11-21 04:37:03

Is there a where to go from here section in HTDP?


jaz
2017-11-21 04:38:34

There is [http://www.ccis.northeastern.edu/home/matthias/HtDP2e/part_epilogue.html#%28part._moving-on-devs%29], though I’m not sure if it’s quite what you’re looking for.


dustin
2017-11-21 04:42:21

This is a really great point.


dustin
2017-11-21 04:51:14

This is a seriously good quote from that section:

>Some of you wanted to see what computing and programming are all about. You now know that computing is merely a generalization of calculating, and you may sense how useful program design is to you. Even if you never develop programs again, you know what distinguishes a garage programmer from a serious software developer. When you interact with developers as a professional, you know that systematic design matters because it affects your quality of life and the bottom line of your business.

Think I’ve been talking to too many of those.


dustin
2017-11-21 05:03:44

I wanted to like the Scala language, but every time I’d mention it around a Haskeller, they immediately say something like: Scala is dishonest about what it can do, it’s a horrible language—no one should ever use it— on and on, etc.

I think one of the things I look for in languages/libraries/tools (at least in my experience with frontend), is the support system, documentation, all of that. I think the Racket community understands this. Alexis made a post about documentation and I thought she summed that up nicely:

http://lexi-lambda.github.io/blog/2017/08/28/hackett-progress-report-documentation-quality-of-life-and-snake/\|lexi-lambda.github.io/blog/2017/08/28/hackett-progress-report-documentation-quality-of-life-and-snake/

It’s probably one of my single most regarded ways in making decisions: quality of life—that’s a great way to put it.