Many people find Racket a useful tool. I’ve yet to find something you can do in Python that you can’t do in Racket, and many things are far easier to do in Racket. (Racket is often faster too)
For a good outline of the capabilities of Racket see the homepage of the Racket site: https://racket-lang.org/ - for more details follow that with the Racket Guide or Reference.
Bw
Stephen
The resources others have suggested are all very good, and I second them. I'd also like to point out some other places to get some human help when all else fails:
This is a very good question.
Here is one view:
Consider this situtation: The function f calls a function g. The function f needs several values from g. Without multiple value return, g must pack the values in a list (or vector), which is then passed to f. Then function f then immediately unpacks the list.
With multiple value return, the values are just pushed on the stack. Thus no packing and unpacking is done.
Whether this should be called an optimization hack or not, is up to you.
For a very interesting discussion with many different views of the matter, see this discussion in comp.lang.scheme (35 persons participated!).
https://groups.google.com/forum/#!topic/comp.lang.scheme/ruhDvI9utVc%5B1-25%5D
In case you are dying to try out Sketching, but don't have any inspiration: pick an example from the Processing web-site and port it to Sketching.
https://github.com/soegaard/sketching/projects/1 https://processing.org/examples/
After looking into this a bit myself, I think my best bet might be to combine Svelte (a lighter-weight competitor to React) with Pollen.
Svelte uses a syntax that is very similar to HTML with custom tags. One example from the Svelte home page has this code in an App.svelte
file:
<script> import Nested from './Nested.svelte'; </script>
<style> p { color: purple; font-family: 'Comic Sans MS'; font-size: 2em; } </style>
<p>These styles...</p> <Nested/>
And this code in a Nested.svelte
file:
<p>...don't affect this element</p>
All of that looks like it would be easy to generate with Pollen. So I could have something like:
(script "import Nested from './Nested.svelte';") (style " p{ color: purple; font-family: 'Comic Sans MS'; font-size: 2em; }) (p "These styles...) (Nested)
This would get the Racket syntax that I love, but compile down to Svelte code (which would then compile down to vanilla JavaScript).
Are there issues with this that I'm missing?
I use Pollen and I think its fantastic. Is the website your are looking to build a static site, i.e. a blog, landing page, something that doesn't need to interact with processes running on a server? That is the best use case for Pollen, and if that is indeed what you are doing, you do not need a web host that supports racket, or an instanced server. There are a number of free static hosts. I would recommend Github Pages, which would allow you to write your pollen content locally, render it, push it to a repo and have it online instantly.
What version of Racket? Did it come from the site, Ubuntu's repos, or another location? This stuff can matter.
For what it's worth, I just checked DrRacket from Racket 6.7 on Debian stable and it's not behaving that way at all. The one in Debian's repo is massively outdated, so I grabbed it off racket-lang.org instead.
Maybe you should try that if you haven't. Or perhaps try the Nix package, which is a little behind (6.6), for comparison.
I know of several people who use Emacs to do most of their day-to-day work in software development, taking notes, calender, IRC chat rooms, even email. Emacs is based on a Lisp dialect called Emacs Lisp (a.k.a ELisp).
I think Scheme and derivatives (including /r/Clojure and Racket) are a little more modern with some more advanced features and syntax, as compared to Lisp, like an easier-to-type object notation, interfaces, and namespaces.
You could think of modern IDEs like LightTable and NightCode as kind of modern, Clojure-based replacements for Emacs. And, of course, Racket has it's own IDE as well.
I do all my personal projects in /r/Haskell, which is a little like Racket but with infix operators so you don't need to write parentheses all over the place, it has a "do" syntax for defining functions that feel very similar to languages like Python, and also it has (in my opinion) the worlds most advance static type checker.
I finished most of into-transduced
last week, but not all. So this week I'd like to get that finished and merged. Then maybe I'll take a crack at the Racket 2019 game jam.
Using Racket/rash for my day to day work. I'm currently using a few Racket scripts that automate gradually changing some configuration files, check them into Git, and then applying them to my production environment, and reloading the service using the configurations.
Setting up Racket Advent of Code Leaderboard (more info forthcoming.)
Roughing out a Baseball Sim for Racket Gamejam.
Also checking out the current submissions for the Gamejam!
My only suggestion is to check if it is a known issue with either the Magic Racket or Remote - Containers extensions?
https://code.visualstudio.com/docs/remote/containers
If it's not known issue you should add one - try to be as detailed as possible.
Sorry I can't help.
KR
S.
Here is the function declaration from the leetcode problem OP referenced.
(define/contract (remove-element nums val) (-> (listof exact-integer?) exact-integer? exact-integer?)
)
Tell me that function does not take a list of exact-integers.
If I understand correctly, the publisher has allowed an online copy as html, but not pdf. The publisher is probably afraid no one will buy the book.
Note that the license of the book has a NoDerivatives clause: https://creativecommons.org/licenses/by-nc-nd/2.0/
Which means that if you make a pdf-version, you can't distribute it. However it is ok, if you make a personal pdf-version.
Personally I don't think there's any real reason to use Emacs over Vim for racket development if that's your workflow. I use Emacs because I want a lisp based environment when I write lisp. However for most people it's a big time investment to get to what will likely be an insignificant improvement in your workflow.
I think it's worth trying out both so you can understand what features your missing out on, but if all you care about is writing lisp, then just write it and to hell with what other people think.
Side note: Try Spacemacs if you want a good idea of what Emacs can do | http://spacemacs.org/
Two free and superb online books that can help you to think functionally:
SICP is faster paced, whereas HTDP explains things more systematically.
I'll be honest I started HtDP and got through a bit but decided to take a break and work through "The Little Schemer" series.
I highly recommend these for getting your feet wet with learning how to think about programming. The Little Schemer specifically targets recursion but it's quite useful in that right.
Be prepared though, it's one of those books that lulls you into thinking it's easy and then the last two chapters stretch your mind in crazy ways.
Structure and Interpretation of Computer Programs is another great book if you have a backround in mathematics.
Once you have a few weeks in Racket from HtDP or The Little Schemer I recommend downloading a copy of RSR7 (The current Scheme specification) and reading through it. Technically Racket has drifted away from basic Scheme and added on a bit to be more batteries included but it's very useful still for learning the general reasoning behind all the basic Scheme functions. http://trac.sacrideo.us/wg/raw-attachment/wiki/WikiStart/r7rs.pdf
Lastly, the Racket Guide on the website is fantastic (although I believe it assumes you know how to program from HtDP)
Realm of Racket is another good book but once again hinges on HtDP.
tl;dr Check out HtDP, The Racket Guide, Realm of Racket, SICP, The Little Schemer, and The Scheme Specification (R7RS or R5RS)
Amazon: $63
Google Shopping: $30 - $115