I call it Go, but usually google for ”golang”. As the term ”go” is un-googleable. Dont know what the fuzz about, no one thinks the language is actually called ”golang”. In the same way racket is usually called ”racket-lang”, hell, even their domain is https://racket-lang.org/
If you're looking to work through the exercises in the free online book (and you should), the amazing Racket language / ecosystem (formerly PLT Scheme) has the very nice DrRacket IDE plus support for studying SICP via its custom language: #lang SICP.
I originally came to Racket (then PLT Scheme) when I started to read SICP and wanted a friendly-to-newbies scheme.
Racket is a lisp whose main goal is to simplify language creation.
You may also be interested in the Truffle/GraalVM project. Truffle is a library for creating interpreters in Java. Graal is an experimental compiler for the JVM which can take Truffle interpreters and compile programs in that interpreted language both JIT in the JVM and AOT into a binary executable.
This was going to be my suggestion as well. As much as I like Clojure, Racket is a much better choice for teaching a beginner. It has a super easy "get started" experience by providing the runtime, IDE (DrRacket), and a bunch of basic libraries in a single package. As an IDE, DrRacket isn't a good choice for an advanced user, but it's great for a newbie, with good-enough usability, good error messages, and great visual feedback for things like showing where a defined function is called in the code, or even cool things like being able to store and display images in the REPL.
Plus, the combination of a Scheme and How to Design Programs lets you teach programming principles instead of focusing on language syntax. Even without HtDP, Racket's a good beginner-friendly, batteries-included Scheme, making it a good choice for teaching FP, abstractions, library usage, and other basic programming concepts without getting hung up on syntax and language oddities. Basically, you get most of the same advantages as teaching Clojure, without a lot of the major negatives of it, and you get a good base for moving onto another language, maybe even Clojure, later.
If you do decide to try using Clojure, though, I'd suggest going with ClojureScript by way of Lumo. CLJS is slightly better with error messages, and Lumo makes it fairly easy to get up and running, good for scripting tasks and the like, and no Java or figwheel baggage to interfere with learning. The basic things learned will still translate to normal Clojure or ClojureScript use, but allows learning with less up-front effort that might be discouraging.
I read through the whole book a few years ago and did nearly all the exercises. The last two are still on my TODO list as life happened and I just didn't have the time nor energy.
This book had an extreme, and I think good influence on me as a programmer. It's on top together with The Pragmatic Programmer and The Art of Unix Programming as the big trio that made me who I am today. While I don't use the concepts much in my everyday work, the way I think about problem solving in general has changed. You can find some of the concepts from the book in nearly every language out there, from JavaScript to C#, even in Golang. I'd even say most other programming languages are slowly becoming more Lisp-y. Have a look at Racket and How To Design Programs aswell.
Here's the link to the textbook. It's online and it's free. Take a look and start reading through the first few chapters. Download Dr. Racket and fiddle around in it a little. Do some of the early exercises in the textbook if you like. The first course does not require previous programming experience but these are things you can do to be a little more prepared when you get here.
> Put another way, it's like if in LISP, instead of only being able to use one dialect at a time, it was possible to use several at once.
How does this compare to Racket [1] ?
Racket has a macro system which is used to implement other languages which are then able to operate together, although I think it is still one language per module.
I'm the author of the post you linked to :)
Unfortunately, GNU Guile on Windows is in a sad state. I've not been able to build any versions of Guile after 2.0.11, and since Guile uses gnulib, Windows is more or less treated as a secondary citizen. However, 2.0.11 does work and it's pretty good together with Emacs as the IDE.
Other free alternatives is Chicken Scheme and Racket. Chicken also comes with its own package system which is great in order to get started quickly.
I'm not sure whether Racket can be embedded, but Chicken certainly supports this.
Like your friend, I really recommend learning a flavor of Lisp. The intro to computer science courses at my uni were all taught in Racket, an evolution of Scheme which came from Lisp. I loved using Racket and the textbook we used is available completely online for free[0]. That said, if you want to learn a more widely used Lisp, I'd recommend Clojure which runs on the JVM; there's many great books on it available.
You likely won't use Lisp in your day-to-day life but the ideas and ways of thinking you get from learning it will influence how you think about and design programs in other languages. For example, I use mostly Python and Ruby and feel learning Racket/Lisp has made me a better programmer.
[0] http://htdp.org/2003-09-26/Book/ -- it uses "beginner languages" in Racket in order to teach good practices. If you just want to dive straight into Racket, the documentation can be found here https://racket-lang.org/
closest thing today is https://racket-lang.org/ but that doesn't just come on your computer. but yes it is I think a great sadness that most modern languages completely ignore the question of "draw a pixel on the screen" or "make a gui" meaning we have to turn to C library bindings or electron to do anything visual.
something akin to SDL2 should be part of any standard core library the same way opening and reading/writing files is.
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
Try Racket.
Also by cruft I assume you mean historical baggage. It's very unlikely you'll find a language + compiler + environment that brings all the advantages of GHC + Hackage without giving something up. So the answer to your question is what are you willing to give up? Semantics, laziness, performance (in class), types?
Interesting! I find myself firmly in the first camp during work hours because of really tight deadlines that are forcing us to cut corners (my team and I, aside from one of the senior members and the tech lead, are all new devs).
I do spend some of my free timwe looking at stuff e.g. about code smells, and I also learn other languages like Raclet to see what they can show me about FP, recursion, et. al
Hah. I used to complete Project Euler problems in Racket while waiting for compiles (which took 1-2 hours after we finally stabilized the build infrastructure) to finish. That and go have conversations with coworkers; pretty sure my talking to coding ratio was at least 3:1.
The project I worked on was quite large with at least 100 developers having touched the code with many only working in that code base. It was also quite well designed in both the "business domain modelling" sense as well as the "we have a small, core technical philosophy to use when solving problems" sense.
This project was adjacent to an A+ (APL derivative) project that was being deprecated. As A+ is interpreted and has quite the "code while the application runs" feature set, I was quite jealous of the A+ developer productivity.
Can you find out which textbook the university will be using? Why not start there?
Is there a static-analysis tool that would restrict the usage of specific libraries or language features?
Basically the idea is to allow "sub-sets" of Scala in a controlled fashion (like the Racket Scheme environment does).
I am aware of Scapegoat and Scalastyle, but I don't think they can be used for this...
How to cook.
The basics of at least one programming language, I'd pick C (for the pointers) or Common Lisp (the uber language) (or Scheme or Racket).
Have a look at Structure and Interpretation of Computer Programs (available for free online here [https://mitpress.mit.edu/sites/default/files/sicp/index.html] and as a print book). Download DrRacket (free) [https://racket-lang.org/] and do the exercises from SICP.
If that excites you then CS is for you. If not, then you should possibly consider something else.
Good luck! You can ask for help on /r/scheme and /r/racket.
You might want to use DrRacket to write your programs (pick R5Rs as the language):
I began to appreciate the usefulness and sanity of FP after my experience with the calamities of OOP in C++ and Python.
Attempted to begin with Haskell several times but failed to learn it beyond the basic level. Then came across Racket and HtDP which was like a revelation for me.
I still plan to learn Haskell up to an intermediate level -- hopefully soon.
You have good intentions but this seems misguided. Once you do that, you've made it practically impossible for anyone using your language fork to use any online resources; whereas with the original language, even if they can't understand the surrounding discussions, they could at least find code snippets and experiment with them. You'd be making things worse.
Furthermore, even if the words resemble or are equivalent to a spoken language, you have to remember that a programming language still isn't English or any other language. Sometimes the keywords match up to their expected English meaning, but that's not a guarantee that should be relied on. For example: map
and fold
don't quite match up to their most commonly-used English meanings, and worse still, map can either be a function or a data structure (or both) depending on the language; some words like lambda
are rarely seen outside of mathematics or programming; and sometimes English expectation is completely counter-intuitive, like OCaml's anonymous functions using the fun
keyword, which has meaning in English that doesn't match the language use.
Reading code is more like reading music than prose. You learn what the symbols mean and how to use them, and translate that into something you understand as you read them.
That said, if you're determined to try it, you can go a long way with C preprocessor directives. The original Bourne shell was written like this, using #define
liberally to turn C into something more like Algol. Localising keywords is trivial incomparison. Racket, a Scheme dialect, has the ability to define custom languages and language extensions and use them by adding #lang foo
at the top of source files, so you could make a translator for it as well.
Still, I think it's a well-meaning but poorly thought out idea.
I would certainly try to use a Scheme to work through SICP, it expects some features like tail-call optimisation Common Lisp doesn't guarantee. Maybe installing Racket is the easiest solution, since it has a decent IDE which isn't hard to learn, and I think there is an SICP compatibility mode.
I'll mention Racket and its very readable Documentation.
2D drawing is included, .exe file is possible and the standard library can do a lot as the documentation shows.
you can definitely write your own language - but your first one (or few) is likely to be more of a learning exercise than your dream language. So, realistically it could take a while, and be a serious time sink. LUA is small but extremely sophisticated and written by a prog lang genius.
So if you need a language to embed, you should probably consider one of the existing ones. If you really want to learn how it works, learning Racket is a good starting place.
I would personally start of with Scheme. Apart from anything else, you get a nice development environment in the shape of Dr. Racket (Racket is a Scheme dialect) - I've not been impressed by any of the Haskell dev elopment environments.
> and macros, even hygienic ones, don't let you stray from that. At the end of the day, your DSL will look a lot like Lisp, with parentheses and some limited support for infix, but it will be immediately apparent it's a Lisp DSL.
This is simply not true, and hygiene has absolutely nothing to do with that. A macro allows you to write code in any syntax whatsoever (with parentheses, without parentheses, whatever you like; e.g., take a look at the datalog example on the Racket homepage). The reason Lisp macros usually follow the Lisp syntax is so that it blends more nicely with Lisp code, it's easier, and because Lisp programmers like it that way.
> Groovy, Scala and Kotlin are much more powerful and flexible to implement DSL's than Lisp ever was.
This is just not true. Kotlin (and Groovy) is definitely significantly weaker; that's by design and it's a good thing -- for Kotlin. Kotlin doesn't have any capability to manipulate syntactic expression, nor even any additional metaprogramming capabilities beyond Java's (unlike Groovy). Scala macros are as powerful as Lisp.
For example, in Kotlin the user cannot implement continuations (although they're now built-in to the language) as possible in Scala (Scala Continuations) or Lisp (Clojure's go blocks), and even much weaker forms are not possible. Again, this is by design, and a good thing for Kotlin's design goals.
The others seem to have decided that you need to write a compiler. How about writing an interpreter instead to get started? Much easier. How about doing it in Racket? Scheme is the perfect DSL language if you don't (at first, at least) care about syntax. Do it in a DSL embedded in Scheme, deferring the question of syntax for later when you figure out how to do it in Racket, let it pan out, then think lexers, parsers, code generation, optimizers, virtual machine, ... (you will probably end up with LLVM).
This suggestion is closer in spirit to that of /u/takikawa than the others that I have read so far.
Start here:
https://github.com/schemedoc/bibliography
Papers related to Racket:
https://racket-lang.org/learning.html
Check out the personal home pages of your favorite Scheme impementors.
Also, Racket Stories links to papers.
If you are interested in learning how to program with a beginner friendly, yet wholly capable, programming language then Racket (https://racket-lang.org/) is an excellent choice. But beginners will need guidance and for that I recommend this book: http://htdp.org/2021-11-15/Book/index.html
I learnt a lot from HTDP, but I understand not every book works for everyone. The best advice as a solo learner is to do the exercises and ask questions when you get stuck. And don't get discouraged - you WILL learn to program it will just take some time to get started.
In addition to my comment about welcoming new learners, there are a variety of other Racket books; I recommend Realm of Racket. See books at https://racket-lang.org/books.html
Another book which does not use Racket but is written by one of the authors of HTDP is A Data-Centric Introduction to Computing https://dcic-world.org/ ; what you learn there is applicable to Racket. (or any language) They also have a mailing list and a discord server manned by the authors if you have questions.
You're asking the Pascal forum. The answers might be biased. :-)
That said, Pascal is a solid language with a clean design that avoids many of the surprises and confusions of some popular languages. While not neglected by any means, it is still not as well supported as whatever the language of the year is now. I don't know what good introductory books are available these days.
Pascal is a particular flavor of programming languages: strongly typed, imperative, structured, procedural (with object-oriented features in recent implementations). If you're learning this out of curiosity, you might also like to explore the Lisp family of languages, which are almost completely different. I think that Racket is a good starting language.
Racket used to be called PLT Scheme and was an implementation of Scheme. But they decided to diverge from being “Just a Scheme” and to be its own language. They renamed it to Racket at that point. See https://racket-lang.org/new-name.html for more details.
No worries, and you are welcome. As a side note, you could go for the "land of lisp" or "<em>realm of racket</em>" both are quite good and engaging - lisp is the mother and racket the daughter. <em>Racket</em> does have a more visually appealing aesthetic.
Have a lovely weekend. :)
Look into Racket. It is a functional first Lisp with a good set of libraries and a nice IDE. You might need some time to get used to the syntax but apart from that it feels similar to python.
I'll say having an understanding of functional programming will be great! And SICP (a course from MIT and a book with same name) is pretty good for that. You can stop after the streams lecture, but it'll be great if you can continue! Many languages implement these features so learning this will be very helpful. link
You can use racket for practice.
>> I think allowing libraries to define new syntax is much nicer than having to extend the compiler every time. >> > I think that's a horrible idea, and every project I've seen that used that feature was shortly crushed under the weight of it, because no one could be effectively on-boarded. >
I can think of one language in which this is not true, and that is Racket. The Racket people have been trying to popularize the idea of "Language Oriented Programming," and they have gone out of their way to make to make Racket's macro programming facilities easy to use for defining new syntax, with a lot of success. Although it is still largely an academic/educational language, it has been going on a while and has been gaining in popularity over the years.
You probably want either HTDP or Realm of Racket, both linked are https://racket-lang.org/books.html
Those will give you a good start for SICP.
SICP has some exercises that rely on some engineering knowledge. Not too many. YMMV.
I found it useful to write a dense, laconic summary. Take exam questions, a bunch of (e)books and write your own retelling of answers in as little words as possible. Don't limit yourself by break schedule, deep concentration is priceless and when deep in task you don't really tire from it and can remain productive for 4-5 hours in a row without noticing the flow of time.
Another point to look at is that you *need* practical exercises of concepts and ideas for them to stick with you, especially for applied math. Do exercises. Pick up R and check some hypothesis based on available data sets. Take up racket and code numerics. And so on.
For languages: read. Read a lot. And then read some more. Start with semi-technical texts and textbooks as they are easier and then move to fanfiction and then proper fiction. Then go to native language forums if you can't find place to practice talking. In my experience for studying languages textbooks are essential to learn basic grammatical constructs, but after what books consider "intermediate level" you pick more reading with dictionary at hand than by working textbook.
Strangely enough, reading about a subject in a foreign language helps. Sure, it takes more time, but you have to spend more time mulling what is told in the book and it helps for the knowledge to settle.
You're in for a treat, then. Scheme's a lot of fun once you get the hang of it.
Just bear in mind that Scheme's very fragmented. Every implementation is different and there's not much portable code. The basics are pretty much the same, but everything else is up for grabs. Most people I've talked to pick one or two implementations and stick with them. I personally use Guile, but I wouldn't use it for SICP.
The Scheme used for SICP is a really old Scheme. I haven't personally used it, but I've heard good things about Racket's #lang sicp (and Racket itself, for that matter). Racket works with Geiser in Emacs so you should be able to get the full REPL experience. When you're ready to move on to a more full-featured Scheme, Racket has support for many other dialects as well, and its default language is pretty impressive. It's what I would probably use if I hadn't already invested myself in Guile.
You seem to be trying to write Scheme in Emacs. Emacs doesn't support Scheme; it supports Emacs Lisp, which is a different Lisp dialect.
Have you tried DrRacket instead, which supports Scheme syntax?
If that’s the case you might want to go into academic research into algorithms and programming paradigms. Your favorite language might be Haskell https://www.haskell.org/ (try the brief tutorial on the web site) or maybe lisp (specifically Racket https://racket-lang.org/ which is a version of scheme).
Dude I'm just blown away by racket's website. The little I read about it impressed me, the way it treats graphics and images and how the language was concieved (to desing languages). Thank you so much! I'll definitely look into it, problably after I learn CL.
I think removing all these peculiarities can be a great way to teach Haskell. I wish we had something like Racket’s #lang
in Haskell, so we could gradually add features to the language. Using NoImplicitPrelude
is a good option, I think, and maybe better/easier than creating a special language. I saw a post here recently about someone teaching Haskell this way, using custom type errors, I believe (sorry, can’t find it). Using this approach, you of course can’t (yet) remove features specific to the language, but you can start without polymorphic types and functions (data IntList = Nil | Cons Int IntList
), use easier syntax for lists (data List a = Nil | Cons a (List a)
) and eventually introduce the [a]
and x:xs
syntax.
Lisp is really a family of languages. Scheme, Racket, and Clojure are all in the Lisp family. Lisp is one of the oldest languages still used today, it was first invented in 1958, but it is so powerful that it is useful even now.
The benefit of Lisp-like languages is that they have the most minimal possible syntax of any language. There are basically three rules: 1. brackets denote nodes of the abstract syntax tree, 2. symbols are anything that are not whitespace or brackets, 3. symbols are leaves of the abstract syntax tree.
The semantics of the language are simple as well: the first leaf in a syntax tree node is the command/function to call, the rest of the leaves in a syntax tree node are the arguments to the function. You have a few built-in functions, like a command for declaring a variable, a command for declaring a function, and a command for doing "if-then" like statements. Loops are done with recursion. You can also create "macros" which are commands that write code for you.
From these simple rules, you can create some of the most complex but elegant software systems you will ever see.
But I like functional programming in general. Actually Haskell is my favorite language, it has a more complicated syntax than Lisp, and no macros, but I think Haskell lets you write code that is shorter, simpler, and easier to read. It allows infix operators and, like Python, requires you to use whitespace and indentation to denote blocks of code.
If you want to try functional programming, I recommend you start with Racket because it was designed for educational purposes, and has a very easy-to-use IDE. https://racket-lang.org/ You can also try Haskell in the web browser: https://www.tryhaskell.org/ but Haskell isn't very interesting until you start writing larger programs.
I love the idea of Rust as a first (programming) language. The problem is that knowledge is aquired by building upon prior knowledge. You must introduce variable assignment before scoping rule; flow control constructs before algorithms; etc. In Rust, like almost all programming languages, you can't turn off the advanced features in order to teach the basics. Say you're trying to introduce the concept of a variable and your students are trying to apply what you've taught, what kinds of errors do you think they will encounter? I can guarantee they'll hit the borrow-checker very quickly. It's like learning to ride a bike on a mountain range!
Racket (https://racket-lang.org/) is designed with this in mind. Features of the language/compiler can be switched on one at a time. Students graduate one concept at a time.
I think it would be interesting to modify rustc to support this way of learning. Feature switching is builtin to rustc to introduce experimental features. I wonder if it could be retrofitted to the core features...?
I find it very useful for my students to give Scheme a try. Racket is a nice Scheme with a cool IDE and fun libraries.
Scheme is not the language you'll be using to make a living. It is however something that will teach to to think of algorithms and problem solving in a totally different light. Give it a try.
Go to /r/racket for resources in the subreddit menus
The racket website https://racket-lang.org
Getting started: https://docs.racket-lang.org/getting-started/index.html
And the wiki: https://github.com/racket/racket/wiki
I'd say maybe try starting with Racket and using it to go through <em>How to Design Programs</em>. HtDP uses a custom subset of Racket (which is a Scheme variant) and walks you through programming concepts, starting with simple things and building up. Once you start feeling comfortable you should be in a good enough place to move to proper Racket, another Lisp, or even an entirely different language.
Another advantage is that using Racket also gives you DrRacket, a graphical IDE that is a bit simplistic for experienced programmers, but excellent for beginners. It has a two-pane layout, with code in one and an interactive environment in the other. You write up code, hit run, the results appear in the interactive side, and if you choose to you can further manipulate the state of the code you just ran by evaluating statements in that pane. It also has various helpful visual features for getting information about built-in functions, finding where you defined your own functions, matching parentheses, etc.
Regardless of which way you choose, I think starting with a lisp dialect is actually a good idea for someone with little or no programming familiarity. The lack of syntax to learn and the explicitness of the parentheses means you can focus on programming concepts without having to be distracted by syntax and language quirks.
I want to say no (it's not crazy) because the learning resources are excellent (i.e. the Rust book, rustc --explain
, etc.) and it's best to learn good habits from the outset. If the learner has a good teacher/mentor that can devote enough time and who will be able to anticipate the challenges that Rust will present then it could be doable.
But ultimately you should lean towards languages that are specifically designed for learning. For example, with Racket you can increamental enable features which allows you to control the learning curve, this has the advantage that error messages are targeted to what the learner knows. (Racket also promotes immutable data structures, similar to Rust.) Another popular beginning language is Scratch, which specifically aimed at children but it is more of a toy language. Neither of these resemble Rust.
Remember that Rust is aimed at performance and developer productivity not learning.
If you're learning programming, forget about Python for now and try Racket instead, you'll be much happier :-)
Use this book to learn programming with Racket, you won't regret it https://www.htdp.org/2019-02-24/
I would say the very best learning platform these days is Racket (https://racket-lang.org/). Best documentation around, so that's good for self-learners.
In particular, there are libraries for working with pictures and drawing that should spark the interest of a 10yo (I think).
As for game programming, the Racket community edited the Real of Racket book (https://nostarch.com/realmofracket.htm) exactly for that.
I wish your son success!
Common Lisp is a general purpose programming language so you can use to build any kind of software. Elisp on the other hand is not useful outside of Emacs and of the many dialects of Lisps it's outdated in some ways. But if your main interests are to learn programming and extend Emacs as you go, stick with Elisp. What you learn will be easily transferred to other languages, especially to other Lisps. And if you want to learn a fully featured general purpose Lisp dialect, Common Lisp is a debatable choice anyway -- something like racket has fantastic support for learners.
Echoing my comment from your removed post on /r/linux:
You might try Racket. It's free and cross-platform. It can build GUIs pretty easily, AFAIK. It also has a great IDE, with lots of good support for other text editors.
Reader macros are built into CL, but CL is a Lisp-2 and it is nontrivial to make it a Lisp-1 unfortunately. Maybe Racket would be better then? It also has fancy reader tricks (generalised into "language" parsers) and an implementation of CLOS (Swindle) among other things.
Racket is particularly well-equipped for programming instruction, including integration with the DrRacket IDE. See more input on why Scheme is good for learning programming. Also there is very little syntax to learn in a Lisp/Scheme-like language. Honestly I wouldn't bother trying to teach someone introductory programming in any other FP language, especially not a more pure language.
SCIP is actually compatible with Scheme - to quote from the preface:
> we have rewritten all the program examples to ensure that any Scheme implementation ... will be able to run the code
A great implementation of Scheme is Racket.
My personal opinion: Scheme/Racket, so simple yet so powerful.
But everyone seems to agree on python lately.
Book recommendation: How to design programs.
C and C++ have different use cases, i wouldn't start with any of those.
If you have 0 programming experience, I recommend you start with How to Design Programs or work through it along side of the SICP/CS61A. If you use the recommended videos from Teach Yourself Computer Science, you may also want to consider using DrRacket instead of MIT/GNU Scheme to work through the material. MIT/GNU Scheme uses an Emacs clone as the text editor and interpreter. Which has a steeper learning curve and is not for everyone.
Further, the CS61A recommended videos from Teach Yourself Computer Science are specifically for the class taught by Brian Harvey and based on the SICP book using scheme. Whereas the current CS61A has a new professor (John DeNero) that has adapted the course to use Python while straying from SICP. The Spring 2019 Course seems to not have started yet, but you can access prior semester material (including lectures) and syllabus in the Resources section.
What you choose is your preference, but I wanted share what I learned when choosing my path.
> A final point: why not go for subsets of Haskell, like the Dr Racket approach, https://racket-lang.org?
Racket subset of haskell? I think you mean subset of lisp. Anyway, haskell might be a good language to teach category theory, but I think it would be a horrible intro to FP. Why do you want students arguing with a compiler when you're trying to teach them to recognize functions as objects? You can easily cover the idea of passing functions as arguments, higher order functions, etc. in another language. Personally I'd pick a lisp dialect rather than choosing a semi-functional language like ruby, because you'll miss out on concepts like currying unless you choose a real one.