@loke@functional.cafe avatar

loke

@loke@functional.cafe

Lisp, Emacs, APL and a bunch of other stuff.

From Sweden, living in Singapore.

I always work on a bunch of projects. My current major ones are:

A graphical frontend to Maxima: https://github.com/lokedhs/maxima-client

Kap: An APL-based programming language: https://codeberg.org/loke/array

#lisp #commonlisp #apl #retrocomputing #linux #kap #climaxima #emacs #atari #fedi22

This profile is from a federated server and may be incomplete. Browse more on the original instance.

loke, (edited ) to random
@loke@functional.cafe avatar

On the APL Matrix channel, it was asked what a nice tacit version of the following code was:

5 {⊃⍸⍺=∘.+⍨⍵} 2 3 5<br></br>

It's a bit of an odd piece of code, since it returns the coordinates to the matching value in the resulting grid, but OK.

Some suggestions using Dyalog was:

  • (⊃∘⍸⊣=∘.+⍨⍤⊢)
  • ⊃⍤⍸⍤=∘(∘.+⍨)

The reason I'm posing this, is because I find my Kap solution much nicer:

  • (↑⍸=)∘(+⌻⍨)

I've said this before, but I do believe that the style of function forks that are implemented in J and Dyalog were a mistake. Explicit forks and hooks are much better, and makes plain function chains into simple right-to-left function call sequences.

davidho, to random
@davidho@mastodon.world avatar

Environmental protection is actually a good thing.

loke,
@loke@functional.cafe avatar

@davidho I would love to read more of this stuff. What other gems does this book hide?

dragfyre, (edited ) to python
@dragfyre@mastodon.sandwich.net avatar

Alright #python and #CS heads, here's a little puzzle for you to ponder.

I tried implementing the square root estimation algorithm from #SICP Lecture 1A in Python just for fun (my Lisp skills are weak).

Code: https://cryptpad.fr/code/#/2/code/view/W2yHJixW0qyk1BnUcxIwGtxAKszQ54qPngLI9ztwfx8/ (also, see image.)

Notably, I made the precision variable so that I could see how precise a value I could get. I tried it at lower precision at first and it worked, so I bumped it up. Seemed to work fine, until I got past 16 significant digits... (1/3)

loke, (edited )
@loke@functional.cafe avatar

@dragfyre There is nothing wrong with your algorithm. It gives the correct result within the precision of the number representation you're using.

In your case, you're hitting the limits of 64-bit floating point, and the reason you are getting different results is because the implementation of sqrt that Python uses (which appears to be the default libc implementation) is more accurate than yours for some specific inputs.

I took the libery to do an almost 1-to-1 port of your code to Kap, which allows you to try the same thing using rational arithmetic. When you do so, you get a value that is as precise as you tolerance value:

Click "send" to run the code.

Kap version of the code which supports both types of numbers

I also took your code and tested it on a 100 different values (0 to 5 with a step length of 0.05, and it gives you several other values for which your algorithm gives an imprecise value with floating point arithmetic:

code that computes imprecise guesses

acdha, to random
@acdha@code4lib.social avatar

Any sympathy I might have felt for the Humane AI founders just evaporated:
https://arstechnica.com/gadgets/2024/06/report-humane-ai-pin-did-7-million-in-sales-wants-to-sell-for-1-billion/

loke,
@loke@functional.cafe avatar

@acdha That explains the weird comments suggesting that Marquees was acting "immorally" by criticising the product.

"how could he do that, it's against our corporate values to say out product is bad"

loke,
@loke@functional.cafe avatar

@acdha That explains the weird comments suggesting that Marquees was acting "immorally" by criticising the product.

"how could he do that, it's against our corporate values to say our product is bad"

augieray, to random
@augieray@mastodon.social avatar

Small #COVID19 update:

As predicted a month ago, COVID infections are starting to rise in the US. The rise is not great (yet) in most of the nation. (For instance, here in my home state of Wisconsin, we remain near our 12-month lows.) But, this is not the case everywhere--in fact, there are places with very high levels of infections based on wastewater metrics. (1/6)

loke,
@loke@functional.cafe avatar

@augieray Singapore definitely see it. I got an sms from the ministry of health reminding me to get a booster because it's been a year (I honestly thought it was only 6 months) and they mentioned that the numbers have been going up.

Sadly the message came just as I had recovered from what must have been covid (even though my tests were showing negative)

loke,
@loke@functional.cafe avatar

@augieray this one was bad. 10 days, really bad cough attacks, and loss of smell that lasted almost another week.

I've recovered now, but I really don't want to get it again. I'm getting my booster shot as soon as possible.

loke,
@loke@functional.cafe avatar

@augieray thanks. A lot of people here have had something similar in recent weeks. You know it's a big spike when a lot of people are on sick leave at the same time, and the moh senda you text messages reminding you to get vaccinated (I haven't had any such messages since 2021 or so)

Miriamm, to random
@Miriamm@mastodon.social avatar

These are the type of statues we should be putting up. Danuta Danielsson hitting a neo Nazi (1985).

loke,
@loke@functional.cafe avatar

@Miriamm The photo is of course famous, but I had no idea there was a statue of it. Looking it up on Wikipedia, iut appears that it has been controversial because it's "promoting violence", which I find somewhat backwards (paradox of tolerance?). Apparently this one is a copy of the original statue that was rejected, and can be found in Alingsås.

lowqualityfacts, to random
@lowqualityfacts@mstdn.social avatar
loke,
@loke@functional.cafe avatar

@lowqualityfacts I spent more time than I should have making sure that all letters were included. I'm sorry to say, they weren't. Þ is missing.

Dtl, to random
@Dtl@mastodon.social avatar

Spotted on the #emf2024 swap shop. Amazingly enough the text wasn't just 200 pages of "Don't" in different typefaces and languages.

loke,
@loke@functional.cafe avatar

@Dtl Which UI framework are they using in it?

loke,
@loke@functional.cafe avatar

@Dtl It may be text-based user interfaces for DOS then?

I suspect if they were using some X-based UI framework, the title would say so.

loke, to random
@loke@functional.cafe avatar

As a programming language designer, I think it's bound to happen, but every time it does, it really makes you question yourself:

When people shows they are better at using your language than you are.

I think game designers must feel this all the time.

loke,
@loke@functional.cafe avatar

@tfb I agree, if "love" is a synonym for having an attack of something that bears a resemblance to imposter syndrome.

You feel that you are supposed to easily best whatever the person did. How could you not? You know everything about the thing.

NanoRaptor, to random
@NanoRaptor@bitbang.social avatar

1989's Macintosh SE/30L is remembered as one of Apple's biggest flops. MacWorld criticised its rotated L display as "...bringing all of the issues and none of the benefits of a true L display", while MacWeek called it "Some kind of deranged P display nobody asked for".

loke,
@loke@functional.cafe avatar

@NanoRaptor In this decade they revisited this idea, now called "dynamic island"

dev, to random
@dev@discuss.systems avatar

I’ve found the best wifi name. In awe of whoever’s network it is. ᓚᕠᗢ.

(Figured out the symbols after consulting a Unicode consortium friend)

loke,
@loke@functional.cafe avatar

@dev The names of the caharacters are:

CANADIAN SYLLABICS LA CANADIAN SYLLABICS THI CANADIAN SYLLABICS CARRIER TTU

Just in case you want to know how to pronounce it.

loke,
@loke@functional.cafe avatar

@dev The names of the caharacters are:

U+14DA CANADIAN SYLLABICS LA
U+1560 CANADIAN SYLLABICS THI
U+15E2 CANADIAN SYLLABICS CARRIER TTU

Just in case you want to know how to pronounce it.

mwl, to random
@mwl@io.mwl.io avatar

$58 dollars from breaking another arbitrary round number.

This whole thing is insane.

https://www.kickstarter.com/projects/mwlucas/run-your-own-mail-server

loke,
@loke@functional.cafe avatar

@mwl very arbitrary. 😀

dansup, to random
@dansup@mastodon.social avatar

While I love being a lone wolf fedi developer, having nobody to discuss development with gets lonely

My partner, friends and family are not devs, so I resort to our discord and matrix channels to excitingly explain my dev related ideas, progress and thoughts, but it's rare to get a reply

Maybe I should settle with AI, I'm not looking for friendship or general convos, rather more technical discussions related to the context

Not being able to explain/share how proud you are of your code sucks

loke,
@loke@functional.cafe avatar

@dansup where is the matrix channel? I why am I not on it yet?

TheBreadmonkey, to random
@TheBreadmonkey@beige.party avatar

The internet is a confusing place. I was looking for news stories about Mr Blobby, then I somehow fell down an INSANE rabbit-hole so that when my wife came in and asked what I'm doing because I'm supposed to be getting ready, I said to her the following..................

I'm trying to verify that the man who holds the record for inserting most creme eggs into his anus was eaten by a crocodile.

I hate the internet.

(It's 9!)

Edit - I don't know if they were wrapped or unwrapped and I don't know if he was eaten by a crocodile as the Daily Sport asserts in their article.

loke,
@loke@functional.cafe avatar
loke, to random
@loke@functional.cafe avatar

Is it me that is weird, or is this song remarkably catchy for a Merzbow album? https://www.youtube.com/watch?v=t69vShQFohs

echo_pbreyer, to random German
@echo_pbreyer@digitalcourage.social avatar

🇩🇪 🚨Achtung: Die bisher auf Eis liegende #Chatkontrolle könnte von den EU-Regierungen doch noch angenommen werden. Frankreich droht ihr zur Mehrheit zu verhelfen.

Der “Kompromiss”: Entweder du lässt deine Chats kontrollieren oder du kannst keine Bilder/Videos und keine Links mehr posten&sehen!

Lies alles darüber von @AnjaHirschel und mir: https://www.patrick-breyer.de/chatkontrolle-blockade-wackelt-chatkontrolle-verweigerer-sollen-mit-foto-und-linkverbot-bestraft-werden/
#PiratenKämpfen

loke,
@loke@functional.cafe avatar

@echo_pbreyer That's like a someone giving you a compromise of "if you don't give me your money I will punch you in the face". Well at least you have a choice.

Sandra, to random Swedish

Är MPF redan förlorade? Det känns som om dom lever i landet tvärtom.

Varför tar dom SDs sida?

loke,
@loke@functional.cafe avatar

@Sandra Vad är MPF? Har det ngåot att göra med Miljöpartiet?

loke, to random
@loke@functional.cafe avatar

I like the @404mediaco podcast. I just have one issue with it.

In the introduction, they say "..both online and... irl". In my mind, I keep wanting them to say "...both online and... off".

smlx4, to random
@smlx4@mastodon.nu avatar

I’d say, that it’s time for me to book the appointment with the hairdresser - now!

loke,
@loke@functional.cafe avatar

@smlx4 Me too. Thanks for reminding me.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • tacticalgear
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • lostlight
  • All magazines