10,236 karma · joined February 1, 2010
Lisp isn't some language wild west lacking style and idioms—regardless of whether there's a "go fmt" for it or not. Most open source Lisp code is quite standard and "boring": functions and classes/structs following canonical indentation.
1. Common Lisp has a whole system for defining and declaring types, and implementations do actually use this information to produce safer and higher performing code, including some amount of static, compile-time verification (e.g., you can get "expected an INTEGER but got a STRING" styles of compile-time errors). Fast, competitive-with-C floating-point math is achieved this way. DEFTYPE/DECLARE work.
2. If you prefer a system that doesn't feel like a 1980s barebones type system (i.e., Common Lisp's), then you can use Coalton [1] which adds types to a Scheme-like DSL within Common Lisp, but has a type system like Haskell's (similar to stock GHC + common extensions). Multi-parameter type classes, monomorphization, functional dependencies, etc. Yet it's still fully interoperable with Lisp code, uses the same Lisp toolchain, same Lisp compilers, same Lisp editors, etc. so it really isn't just a language atop Lisp, but something that's integrated within it.
- your program is extraordinarily simple
- you can manage to statically link libc
- you can ship (or statically link) all .so files
- you can ensure your app can run in a sandbox
- you limit the distros you build for
- your app can be built by whatever is on flathub
etc., most solutions to shipping software simply don't work out-of-the-box. Despite the kernel being reasonably stable, userspace APIs are a mess of incompatible.
Building banking apps? Well, even if it's Haskell, the Haskellers were dreaming of GPU compiler jobs, not banking front ends. So you're probably down to literally 5 qualified people on earth who want your job.
But then 3 of those 5 don't want to relocate or have other operational desires that require you to re-think how you run your team, and 2 of those 5 believe so strongly in supply-demand that their salary should be 3x the industry average.
Many companies, including Jane Street, come to the same conclusion: If you really want developers of a niche language, you have to be very good at finding smart people who don't know the language and training them.
Lisp is traditionally not so terse, but still expressive.
[1] From Toward Safe, Flexible, and Efficient Software in Common Lisp at the European Lisp Symposium, "[Coalton] has been used for the past 5 or so years [...] first in quantum computing and now a serious defense application." https://youtu.be/xuSrsjqJN4M&t=9m14s
As of writing, the top comment is "Why?" like the project has to defend itself, on a website that's notionally about curious, interesting, and insightful discussions.</meta>
I used Notepad++ way back when, sort of before I "graduated" to Emacs and the like. I don't know how it's evolved over the past two decades (I presume, intentionally, not much) or what attracts its fanbase anymore. I know I liked it because it felt like a substantial jump from notepad.exe without feeling bloated and slow. At the time, some of the competition felt sluggish while Notepad++ felt nimble.
What do people love about Notepad++ that still isn't really addressed by the "less humble" editors out there?
Why has it stuck with Emacs and its derivatives? I don't know. It seems interest in investing time to make a good Lisp environment for a non-Emacs editor fizzles out once it gets to the difficult part of productionizing it, which is why Emacs continues to be the #1 no-cost choice.
(defun myfun(x)
(let (x)
(setq x 5)
(when (eq x 6)
(print "6")
)
)
)
Which is absolutely not what Lisp code should look like. Emacs-and-kin don't outright stop that, but the defaults are such that it's less likely.____
* Of course, technically, CLOS is something to behold. But you won't sell someone on Lisp because it can do "OOP".
The consequence is that an integration with SLIME would have to be a very extensive contrib [1] that is shipped with the Coalton version the user is using, and updated whenever Coalton is updated. No doubt the contrib would have to be very elaborate—it would have to hook in to basically every aspect of SLIME and SWANK if it should be "Coalton-native", from the display of type errors to how auto-complete is handled. Unless the contrib author is very meticulous about backward compatibility, then version mismatches would make everyone involved unhappy. The contrib author would get annoyed at constant bug reports about things not working (even if there's a nice "your Coalton or contrib are out-of-date" error), and users would get annoyed they have to keep a Lisp library in sync with an Emacs add-on.
None of this gets to the matter that Emacs simply isn't a popular text editor, and it's not really the one people are rushing to learn, even if it has substantial merit. I don't know how trustworthy this source is [2], but it claims that Emacs represents a fraction of a percent of the developer community. Even if it's off by 10x, it's still 1-in-50 developers at best.
[1] There's a basic one that shows Coalton type hints, but not much more: https://github.com/slime/slime/blob/master/contrib/slime-coa...
Nonetheless, "elementary function" is a technical term dating back to the 19th century; it's very much not a general adjective whose synonym is "basic".
[1] https://en.wikipedia.org/wiki/Hilbert%27s_thirteenth_problem
All of these concepts, from sine to real numbers, Bring radicals to complex exponentials, can all be defined in different, equivalent ways. What is interesting are the properties invariant to these definitions.
It still doesn't seem to me that a square root should be any more or less contrived than a Bring radical. Maybe we should call it a ultraradical instead?
Like sine or exp, it also has a nice series representation:
sum(k = 0 to inf) binom(5k,k) (-1)^(k+1) a^(4k+1) / (4k+1)
We can compute its digits with the very rapidly convergent Newton iteration x <- x - (x^5 + x + a)/(5x^4 + 1)
and so on.Why not invite it to the table of functions?
Ellipses are simple and beautiful figures known to every child, but why do we rarely invite the elliptic integrals to the table too?
I guess my point is that "nice geometric interpretation" is a little subjective and hasn't led to much consistency in our choice of which functions are popular or obscure.
f + f*(exp∘log)
where + and * are understood to produce new functions. Sort of Haskell-y. abs(0)
= f(0) ; by defn
= exp(1/2 log 0) ; by defn
= exp(-∞/2) ; log 0 rule
= exp(-∞) ; extended real arith
= 0 ; exp(-∞) rule
If we don't agree with this, then abs() could be defined with a hole punched out of the real line. The logarithm function isn't exactly elegant in this regard with its domain restrictions. :)Can't solve the differential equation x^2 - a = 0? Why not just introduce a function sqrt(a) as its solution! Problem solved.
Can't solve the differential equation y'' = -y? Why not just introduce a function sin(x) as its solution! Problem solved.
A lot of 19th century mathematics was essentially this: discover which equations had solutions in terms of things we already knew about, and if they didn't and it seemed important or interesting enough, make a new name. This is the whole field of so-called "special functions". It's where we also get the elliptic functions, Bessel functions, etc.
The definition of "elementary function" comes exactly from this line in inquiry: define a set of functions we think are nice and algebraically tractable, and answer what we can express with them. The biggest classical question was:
Do integrals of elementary functions give us elementary functions?
The answer is "no" and Liouville gave us a result which tells us what the answer does look like when the result is elementary.Risch gave us an algorithm to compute the answer, when it exists in elementary form.
[1] https://web.williams.edu/Mathematics/lg5/394/ArnoldQuintic.p...
> More generally, in modern mathematics, elementary functions comprise the set of functions previously enumerated, all algebraic functions (not often encountered by beginners), and all functions obtained by roots of a polynomial whose coefficients are elementary. [...] This list of elementary functions was originally set forth by Joseph Liouville in 1833.
which seems to be what the blog post references.
A function which solves a quintic is reasonably ordinary. We can readily compute it to arbitrary precision using any number of methods, just as we can do with square roots or cosines. Not just the quintic, but any polynomial with rational coefficients can be solved. But the solutions can't be expressed with a finite number of draws from a small repertoire of functions like {+, -, *, /}.
So the question is, does admitting a new function into our "repertoire" allow us to express new things? That's what a structure theorem might tell us.
The blog post is exploring this question: Does a repertoire of just the EML function, which has been shown by the original author to be able to express a great variety of functions (like + or cosine or ...) also allow us to express polynomial roots?
- Page 2 and the following example of https://billcookmath.com/courses/math4010-spring2016/math401... (2016)
- Ritt's Integration in Finite Terms: Liouville's Theory of Elementary Methods (1948)
It's not frequent that analysis books will define the class of elementary functions rigorously, but instead refer to examples of them informally.