kennethdevel
2018-7-10 14:00:07

@kennethdevel has joined the channel


kennethdevel
2018-7-10 14:30:40

Is racket pure functional programming?


mark.warren
2018-7-10 14:35:01

@kennethdevel Depends exactly what you mean by ‘pure’. As far as I know you can use Racket in both a functional and object oriented manner.


kennethdevel
2018-7-10 14:38:52

So we can have state and mutable data in racket?


samth
2018-7-10 14:38:57

yes


kennethdevel
2018-7-10 14:42:58

Why do people use racket? What does racket offer the developer? Is it special use cases where racket is good, and other where it is useless?


mark.warren
2018-7-10 14:44:11

Why does anyone use any language? Racket is fun, educational, useful and productive.


samth
2018-7-10 14:45:18

In addition to what @mark.warren said, Racket is particularly good at what we call “language-oriented programming”, and more generally is fast, portable, high-level, productive, comes with high-quality libraries and documentation, etc


kennethdevel
2018-7-10 14:49:27

How is it different from e.g. haskell? I am pretty new to functional programming.


samth
2018-7-10 14:51:04

Haskell focuses on different things — fancy types (Racket is usually written without types), laziness (Racket is not usually lazy), avoiding side effects at all costs (Racket allows side effects when you want)


jerome.martin.dev
2018-7-10 14:52:26

Racket can become whatever language you want. It can become Haskell for example: https://docs.racket-lang.org/hackett/index.html


jerome.martin.dev
2018-7-10 14:56:19

If one’s goal is to develop something useful in a particular domain, better use the most practical language and tools for that domain. But if there is none, or if you don’t like already existing tools, or if they don’t fit your use cases, Racket comes to the rescue as a language for creating languages adapted to what you want, at a minimum development cost.


jerome.martin.dev
2018-7-10 14:58:29

It’s also pretty good at providing a framework for studying and teaching programming language theory.


kennethdevel
2018-7-10 15:00:06

Cool, I guess I have problems seeing the potentional/big picture.


kennethdevel
2018-7-10 15:00:36

Is there any videos or projects that shows what racket “is”?


jerome.martin.dev
2018-7-10 15:01:13

https://beautifulracket.com/ is a good book that explains and uses some of the best features in the language


jerome.martin.dev
2018-7-10 15:02:10

It takes you by the hand into making a brainfuck interpreter in a few lines of code, then build upon that to more complex languages, and finishes with BASIC


kennethdevel
2018-7-10 15:05:10

Sweet, I will check it out.


jerome.martin.dev
2018-7-10 15:05:58

But if you are completely new to lisp/scheme-like languages, I’d first recommend https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book.html


kennethdevel
2018-7-10 15:07:18

I am actually waiting for that book in the mail


jerome.martin.dev
2018-7-10 15:07:25

Great :smile:


jerome.martin.dev
2018-7-10 15:07:38

It was an eye-opening read for me.


kennethdevel
2018-7-10 15:07:43

I have done a little scheme before, long time ago, all I remember is car and cdr


jerome.martin.dev
2018-7-10 15:07:52

ahah


jerome.martin.dev
2018-7-10 15:07:57

I can understand that x)


kennethdevel
2018-7-10 15:08:09

and ((((((((((())))))))))))((()))((((((((((()))))))))))))))))))


jerome.martin.dev
2018-7-10 15:08:18

yep


jerome.martin.dev
2018-7-10 15:09:00

SICP is great because it makes you forget pretty quickly about the syntax and uses the language in simple examples that just make sense


jerome.martin.dev
2018-7-10 15:09:22

as if scheme was just there as a mean of expression


jerome.martin.dev
2018-7-10 15:11:01

I’ve been working as a developer for years but sicp was the first book to put words on what I’ve learned by myself during those years.


jerome.martin.dev
2018-7-10 15:12:11

now I always recommend it, either for new developers or experienced ones


jerome.martin.dev
2018-7-10 15:13:12

but I think it has a bigger effect on experienced developers because it makes them understand deeper concepts they’ve been using without knowing


lexi.lambda
2018-7-10 16:19:03

@kennethdevel I really like this talk by @robby https://www.youtube.com/watch?v=hFlIl0Zo234


kennethdevel
2018-7-10 18:52:42

@lexi.lambda Thanks, I will take a look.


andreiformiga
2018-7-11 00:59:17

what’s a good package for logging?


lexi.lambda
2018-7-11 01:14:59

@andreiformiga Racket includes built-in support for logging http://docs.racket-lang.org/reference/logging.html


andreiformiga
2018-7-11 02:13:01

@lexi.lambda thanks


greg
2018-7-11 03:07:17

A fun logger trick is to combine it with trace and some line chars. https://gist.github.com/greghendershott/a65bea7753bf69b347a5b28bb9fe3ed3


krismicinski
2018-7-11 03:08:16

a little bit out of touch here


krismicinski
2018-7-11 03:08:22

what does this do beyond just trace itself?



krismicinski
2018-7-11 03:10:59

nice!


krismicinski
2018-7-11 03:11:07

should integrate this into stuff while teaching really..


krismicinski
2018-7-11 03:11:28

this seems even better than the debugger for some use cases..


shu--hung
2018-7-11 03:12:18

wow that’s cool


samth
2018-7-11 03:14:56

you should make that a pkg


andreiformiga
2018-7-11 03:29:58

can I assume that loggers won’t add significant overhead?


samth
2018-7-11 03:30:54

it all depends what you mean by significant, but I haven’t had a problem with it


greg
2018-7-11 03:52:39

@andreiformiga The log-<level> functions are smart about not doing work if no receiver is interested in their level, as described here: https://docs.racket-lang.org/reference/logging.html#%28def._%28%28quote._~23~25kernel%29._log-level~3f%29%29


greg
2018-7-11 03:54:37

Also the log receiver (which you often won’t deal with directly yourself) provides a synchronizable event, and the code that displays (or does whatever) with the log output will be running on its own thread waiting for that event. As described here: https://docs.racket-lang.org/reference/logging.html#%28def._%28%28quote._~23~25kernel%29._make-log-receiver%29%29


greg
2018-7-11 03:55:30

So the system is pretty well thought-out in terms of minimizing whatever overhead is unavoidable, I think?