@kennethdevel has joined the channel
Is racket pure functional programming?
@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.
So we can have state and mutable data in racket?
yes
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?
Why does anyone use any language? Racket is fun, educational, useful and productive.
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
How is it different from e.g. haskell? I am pretty new to functional programming.
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)
Racket can become whatever language you want. It can become Haskell for example: https://docs.racket-lang.org/hackett/index.html
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.
It’s also pretty good at providing a framework for studying and teaching programming language theory.
Cool, I guess I have problems seeing the potentional/big picture.
Is there any videos or projects that shows what racket “is”?
https://beautifulracket.com/ is a good book that explains and uses some of the best features in the language
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
Sweet, I will check it out.
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
I am actually waiting for that book in the mail
Great :smile:
It was an eye-opening read for me.
I have done a little scheme before, long time ago, all I remember is car and cdr
ahah
I can understand that x)
and ((((((((((())))))))))))((()))((((((((((()))))))))))))))))))
yep
SICP is great because it makes you forget pretty quickly about the syntax and uses the language in simple examples that just make sense
as if scheme was just there as a mean of expression
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.
now I always recommend it, either for new developers or experienced ones
but I think it has a bigger effect on experienced developers because it makes them understand deeper concepts they’ve been using without knowing
@kennethdevel I really like this talk by @robby https://www.youtube.com/watch?v=hFlIl0Zo234
@lexi.lambda Thanks, I will take a look.
what’s a good package for logging?
@andreiformiga Racket includes built-in support for logging http://docs.racket-lang.org/reference/logging.html
@lexi.lambda thanks
A fun logger trick is to combine it with trace and some line chars. https://gist.github.com/greghendershott/a65bea7753bf69b347a5b28bb9fe3ed3
a little bit out of touch here
what does this do beyond just trace itself?
nice!
should integrate this into stuff while teaching really..
this seems even better than the debugger for some use cases..
wow that’s cool
you should make that a pkg
can I assume that loggers won’t add significant overhead?
it all depends what you mean by significant, but I haven’t had a problem with it
@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
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
So the system is pretty well thought-out in terms of minimizing whatever overhead is unavoidable, I think?