- Common Lisp 50.9%
- Swift 45.8%
- Python 2.2%
- NewLisp 0.6%
- Makefile 0.3%
- Other 0.2%
In particular, updated to reflect the renaming of the file, now speaking of capabilities where it was functionality before. |
||
|---|---|---|
| _morgue | ||
| builtins | ||
| div | ||
| doc | ||
| external | ||
| functions | ||
| io | ||
| l | ||
| objects | ||
| old-regtests | ||
| preload | ||
| regtests | ||
| scripts | ||
| system | ||
| utils | ||
| .gitignore | ||
| Capabilities.md | ||
| LICENSE | ||
| main.swift | ||
| Makefile | ||
| PLAN.md | ||
| README.md | ||
| run-tests.lisp | ||
| subdir-Makefile | ||
Lisp in Swift
After -- to a varying degree -- not being blissfully happy with Modula 2, C, Java, Perl, Go, and Python for this application, it was time to try this pet project of mine in another language. Once I wrote an article https://jyrgenn.dreamwidth.org/30953.html pondering the choice of a programming language, and I excluded Swift, because it wasn't open source and not widely available. This has changed in between. In between it is open source and available on macOS and Linux; a FreeBSD port has gone stale, but that is no longer my platform of choice (sadly). All the world's Linux anyway, right?
Swift has the chance to be what I was looking for -- it is fast (maybe not quite fast as C, but in that league), has static type checking, at least simple type inference, AFAIK some approach to parallelism, automatic memory management, and does not seem to be a pain in the ass. Syntax and semantics seem to be rather clear and well-defined, and it seems to have not too much boilerplate (am not as far to judge that).
So it was time to give it a shot. First impression was good; certainly better than Nim, which kind of rubbed me the wrong way here and there. That is one aspect of a programming language I hadn't mentioned in that article -- I must be able to bend my mind around it. That seemed to be the problem with Nim, with which I found that difficult, and I did not really like it. This does not seem to be the problem with Swift.
Swift's concepts seem straightforward, easy to understand, and well designed for me, and I find it easy to use them in my code. It has been fun from the beginning, because I don't seem to run into major obstacles. It feels a bit similar to Python in parts, which I also found fun to work with from the start. Only here, with strong typing and very explicit error handling, it feels like I get the code more right from the start. I like that.
I was a bit disappointed when I saw the system interface library. Compared to python, where everything looks like it is meant to be as simple to handle as the language, the Swift standard library seems to carry a lot of baggage from being an Objective C library before, and from being intertwined with a complex windowing system, far from being simple to handle. But I'll try to manage.
Currently I still am in the process of simplifying the argument list handling of Lisp functions and the resulting breakage, most likely from trying to make that change more or less automatically. Somthing broke, and I don't know what. Most things seem to work, most of the time, but the program l/factor.lisp, which I wanted to use to benchmark the expected performance improvements of the argument passing change, broke and has so far resisted my attempts of locating the cause. And it isn't the only thing that behaves weirdly. Let's hope for the best.
[ni 2022-12-26]