Cabo Touriñan 2023
@jannem @Edent Interestingly enough, these languages originates from Ken Iverson's work on a notation for expression algorithms. This language (called APL) was not initially intended to be used on a computer, but for communication. This made it naturally terse, using symbols rather than words, because it was optimised for a blackboard rather than a terminal.
He invented some new notation that is used in maths today, including the symbols for floor and ceiling.
These days, I believe APL and its descendants (including Kap and BQN and others) are the only languages that actually use some variation of these symbols for the floor and ceil operations (in these languages, the symbols ⌊ and ⌈ are used.
So, to divide a by 2 and round down looks like this:
⌊a÷2
One thing Kap does which the other array languages do not is to allow the user to define functions, operators and even new syntax using glyphs that are not used by the language. Some functions in the language are defined in the standard library, and uses this technique.
So, today I implemented indexed assignment in Kap. I have for the longest time avoided doing so, because the semantics of the language is immutable, but the syntax itself looks like it mutates an array. After all, that's what pretty much every other language does when faced with this kind of code.
To illustrate, what do you think the following code will return?
foo ← 10 20 30
bar ← foo
foo[1] ← 50
bar[1] + foo[1] ⍝ In Kap, the last expression is the return value
If you guessed 70, you'd be right.
If you guessed this is because the assignment on the second line makes a copy, you'd be wrong. foo and bar indeed shares a reference to the same object.
What actually happens is the when you assign to a bracket expression, a new array is created with the updated content, and the value of foo is replaced.
In other words, it's equivalent to the following expression (which is what you had to write before):
foo ← {50}⍢(1⊇) foo
I.e. take element at index 1, replace it with 50 and put it back in the original array, finally assigning that result back to foo.
It turns out that in practice, you don't have to replace elements at specific locations very often, so explicit syntax for it wasn't really necessary.
But, as I was typing the new tutorial for the language, I realised that trying to explain structural under (i.e. ⍢) to a beginner is not something I want to do, so I just decided to implement the standard APL notation for this operation.
Now, to answer the obvious question why I was hesitating to do it earlier: The reason is that this is actually a very costly operation. The entire array is copied every time you replace a single element. It also prevents lazy evaluation, which is pretty bad, since that's what allows Kap to be fast.
Finally, a beginner user may use this in a loop to initialise an array, which would be a terribly slow.
I do have some ideas how to make the last case faster though. The idea is to allow an array to be mutable until any of its content is read. We'll see if it becomes necessary to implement this.
I've started a new effort to write a tutorial for Kap.
Do note it's not finished yet
But if anyone is willing to browse it to see if it's understandable, and even more importantly, interesting, please tell me if I'm on the right track.
QLD Premier claims LNP victory in bitterly-contested Hinchinbrook by-election
Queensland’s Liberal National Party has claimed victory in the Hinchinbrook by-election in North Queensland. With most of the…
#NewsBeep #News #Headlines #AU #Australia #By-election #davidcrisafulli #Hinchinbrook #kap #Labor #lnp #markmolachino #NickDametto #Townsivlle
https://www.newsbeep.com/279004/
A strange flight above a strange place, in strange winds and through strange clouds - but the views were magnificent. Planina polje (karst field) was semi-flooded again, and as beautiful as ever.
https://kapjasa.si/en/a-watery-surprise/
#kiteaerialphotography #KAP #kite #kites #flying #aerial #karst #field #meadow #polje #Planinskopolje #flood #water #river #Unica #Planina #Postojna #Notranjska #Notranjskipark #Insta360 #Slovenia #delta #rokkaku
For a while I've had this idea that often you want to create a simple form for displaying and inputting values. You want to do that without having to design a full on application, and you also don't really care about what it looks like.
Back in the day, there were tools like forms designers in databases like dbase, or people used visual basic to whip together a quick UI.
I've also seen some creations in excel that are both terrying and wildly impressive at the same time.
I'm not sure what people use these days (other than excel, which is still going strong), but I like to use Kap when working with data in different forms.
Array languages are really convenient when manipulating large datasets, but sometimes I just want to bring up a quick form, to simplify various common operations.
I was inspired by the SCREEN SECTION in COBOL, which allows you to declare input and output fields in a grid, and then read/write the data in it. So that was my thinking when I started working on the forms module for Kap.
It's nowhere near usable yet, but I can at least bring up a window and read the data, which is enough to start experimenting with how things like this can be used. I created a short screen recording showing how it works.
https://www.youtube.com/watch?v=rAMtwDvPrvo
The implementation is platform-agnostic, and I intend to add both HTML-based renderer and a text-based one when used on a terminal.
A link to the following code was shared on my feed. The actual post was about something else, but the anagrams program was interesting. It prints the longest anagrams that was found in the dict file.
Obviously I wanted to write a version in Kap (and yes, I'm posting this to my feed, because unless I try to only annoy people who has previously indicated that they want to be annoyed by me (possibly by following me) 🙂 ).
Here's the implementation in factor: https://github.com/factor/factor/blob/master/extra/anagrams/anagrams.factor
And here is my version in Kap, that prints all different forms of the 10 largest words (i.e. the words with the most anagrams, the biggest having 15 of them.
I just found it a fun exercise to write it in a single line of code.
10 ↑ (⍒≢¨)⍛⊇ (=∧¨)⍛⫇ ∪ unicode:toLower¨ io:read "/usr/share/dict/words"
This tells us that the winner is:
"acers" "acres" "arces" "cares" "carse" "caser" "ceras" "cesar" "cresa" "escar" "races" "sacre" "scare" "scrae" "serac"
I have no idea what most of those words mean.
A relaxing afternoon read about the most amazing festival on the Island at the End of Summer: 13th Creative Days of Faust Vrančić!
It was, yet again, unforgettable, crazy, fun, beautiful, full of love, and *wayyyy* too short. Thank you for having us! 😉
https://kapjasa.si/en/prvic-forever/
#kite #kites #kitefestival #festival #creativity #kiteaerialphotography #KAP #party #concert #culture #exhibition #Prvić #Dalmatia #Croatia
As we are getting closer to Advent of Code, and as a programming language designer, I obviously want to promote my particular dialect of APL.
So what should I do to encourage people to rry it for Advent of Code? For myself, others trying it will help me learn what can be improved, both for the documentation as well as the implementation itself.
Should I offer a prize?
A special kite aerial photography exhibition "Les yeux du vent" ("Eyes of the wind") was held during the fantastic Festival International de Cerfs-Volants de Dieppe 2025 - and the jury selected three of our photos to be included! :-)
Read all about it here:
https://kapjasa.si/en/eyes-of-the-wind-kite-aerial-photography-exhibition-in-dieppe/
#kiteaerialphotography #KAP #kite #flying #aerial #art #photography #exhibition #dieppe #normandie #france #teamslovenia
Tofaş'tan tarihi imza: KAP'a bildirildi: Bursa'da üretimi başlayacak: Tofaş'tan tarihi imza. Kamuyu Aydınlatma Platformu’na (KAP) yapılan açıklama doğrultusunda, anlaşma çerçevesinde FIAT, Opel, Citroën ve Peugeot markaları için K9 modelinin hafif ticari ve Combi versiyonları, çoklu enerji platformunda Türkiye’de üretimine başlanacak.
Ayrıyeten üretilen araçların ve yedek parçaların satış koşulları da bu… https://www.eshahaber.com.tr/haber/tofas-tan-tarihi-imza-kap-a-bildirildi-bursa-da-uretimi-baslayacak-255509.html?utm_source=dlvr.it&utm_medium=mastodon EshaHaber.com.tr #Tofaş #Bursa #KAP #Stellantis #otomotiv