Still Running

Autumn is here. The sun is shining but the air is cold. My wife says I have been sick lately because I'm burnt out, but it might also be because of my son having starting the new semester, which tends to bring about all sorts of colds.

I've been watching a lot of youtube lately, but don't feel very relaxed by it, at least not at the moment. My favourite late night help me sleep youtuber Grimbeard haven't uploaded anything in a while.

I've been feeling a lot more at ease at home though. Somehow being sick recalibrated me to want to spend more time at home, so I changed the opening times of my board game café again. Right now we're open 12-21 thursdays & fridays, 12-16 saturdays. Before I would spend many saturday evenings here as well, which I started to feel is a bit too much. My wife hosts game nights every other saturday, and I hope to encourage local players to do the same. Sometimes though, just ordering a bunch of tags for the lock is too much. I did manage to do it yesterday though.

I wanted to write a bit to see if it feels good in a different way from watching youtube. I've been wanting to code a bit more lately, which I haven't felt like in a year or so. But it's still too hard to just do, I don't feel excited by any programming language at the moment. And making my own took to long. I think it might be the sort of thing that is hard to do while also working with code.

I've thought of looking at Crystal but it isn't a lisp so I feel a bit scared. But it looks neat. Would be fun to at least follow along a tutorial. It has type inference and macros which is what I tried to do with my language.

Okay. Now I don't feel like writing any more.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)

Running a board game café

I started the board game café Ektrollet in august. It's pretty nice. I get to be around board games all day, and on mondays we have game nights where I play great games while "working" (I still serve coffee, I always have enough time to play since I don't cook food/make coffee drinks during game nights).

Right now Ektrollet seems to pretty consistently sell for 12k SEK per month. Since only the rent is 10k, right now we're not going plus. We are in a small town (3k people in the municipality) and still very new, so it is to be expected. Vadstena is a very popular vacation town, so probably most of the income will be during summer.

What's nice though, is that there are still new people coming in, so I think we might be able to get more local customers over time as well. Many of the locals are super nice and hype as well, which gives both me and my wife a huge energy boost. :D We have some regulars too, and it feels like we're building something meaningful. :) We haven't done much with the signage outside either, so multiple customers have come in and been surprised that we serve Latte.

It's hard to find time to do many of the "upgrady" things though, like designing signs and printing posters. To not lose our capital too quickly, I consult as a coder as well. So many of my days look something like:

07:00 Wake up
07:50 Take son to school
08:15 Eat breakfast
09:00 Exercise and shower
10:00 Start coding
10:30 My wife opens and starts working in the café. We open 12:00, but it takes 1-1.5h to open
14:00 Done coding (I try to code for 3h, and take one ~30m break)
14:30 My wife quits, and I start working in the café
17:00 Closing time (unless it's a monday :D)
17:30 Done closing, go home and be with my son until he sleeps at 20:30
20:30 Relax, play something, read something
21:30 Preparing to go to bed

With this schedule I feel that my mental and physical health is doing pretty well! But there's not much time over to improve the café. Some days I have some creative energy left after 14:30, and it might be empty, so then I make the website or write our newsletter etc etc.

Building Counter Building the new counter

Unpainted Counter Posing in front of the built, yet-unpainted counter

Right now the big project is preparing for and installing the new coffee machine, a Uniq Stella 2 Group. Me and my father-in-law are building a new counter on which it will stand, and into which we will install a milk jug cleaner and a knockbox. :D

So far I've been using a La Pavoni Esperto, which I love, but it's not great at making multiple coffee drinks simultaneously. With the La Pavoni the workflow for a Latte is something like:

La Pavoni

  1. Put portafilter on scale, fill it up with 19g coffee
  2. Grind the coffee
  3. Measure again, make sure it's 18g (the grinder eats some coffee)
  4. Release "fake steam" (I have no idea what this is, but I do it because the manual told me)
  5. Insert the portafilter into the La Pavoni
  6. Raise the lever, hold it up for at least 10 seconds
  7. Lower the lever until I feel resistance, hold it still for 3 seconds
  8. Raise the lever for 3 seconds
  9. Push down with 5-8 bars resistance (depending on grind size) for 30 seconds
  10. Pour the resulting espresso into a large glass
  11. Pour milk in a jug 225ml
  12. Steam the milk, takes about 60 seconds I think
  13. Pour the milk into the glass with the espresso

This process I think takes about 5 minutes, possibly more. It's also extremely serial. I can't do any of these steps at the same time that I do anything else. It also takes longer to steam with the La Pavoni than a bigger machine, at least that's what I've heard. I think it has to do with the pressure of the machine. La Pavoni has 0.5-1 bar pressure in the tank, while the Uniq Stella has 9 bars. I think that means more heat, and it definitely means more steam going out into the milk faster.

Unic Stella

With the Uniq Stella, I'll also be able to condense step 4-9 into a single step 4: press the button. And while that button has been pressed, I can do other tasks, like grind beans for another drink. It should also be possible to place milk jugs in a way that allows the 30 seconds of steaming to happen while I do other things. So I can potentially go from 1 drink in 5 minutes, to 2 drinks in 2-3 minutes! I don't know what sort of speed I'll be able to achieve, but it's definitely going to be faster. :)

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Illegible

I don't like pushing myself. I feel like it's very common when I push myself that:

  1. I get burnt out (more or less clinically)
  2. The result isn't worth it

When you add to that that everything is meaningless, we get a question:

Is it better to spend a meaningless existence feeling good or feeling bad?

I still remember one time in school. I think I was 13 years old. I was at home, working on an assignment in natural science. After having gotten bad grades on assignments multiple times due to illegible hand writing, I put a lot of effort into writing properly. This was painful for me. Writing hurt my hand a lot, so my method was generally to write as quickly as possible as to lessen the time I had to feel pain.

But this time I wanted to write properly. So I endured the pain. I wrote carefully and slowly, while my hand started hurting more and more. I tend to have trouble remembering things, but I do remember finishing the assignment, and writing down what song I listened to at that moment. Somehow I had to mark down the occasion, since now I really had fought for something.

When handing in the assignment, I even asked my teacher: "Is this legible?" He replied: "Yes."

A few days passed, and I got the assignment back with the grade. I just got the usual passing grade, with a note: "illegible".

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Coding

In which saikyun rambles on about things he forgot he wrote in earlier posts

I like to have a feeling of flow when I code. The best I've felt generally is using Clojure. Here are the main things I think helps feeling flow with Clojure:

What is the problem with Clojure then? Well, it's on Java. And Java makes it harder to build games. It's slow (and Clojure is often even slower), it's harder to build iOS apps, it's harder to deploy for web (especially with the build sizes going up (there is ofc CLJS)), it's harder to build for consoles. But my main gripe is that it's slow. Immutability doesn't help games all that much either, and writing mutable code in Clojure tends to feel a bit wonky.

I'm not saying it can't be done. I've made a game on CLJS, and have played around with graphics libraries and Clojure. I just feel that it isn't a natural fit. If you could show me a code editor written on Java that doesn't feel sluggish and doesn't eat >100mb ram, maybe I could be persuaded otherwise. Because I feel that it's the underlying platform that's the main problem.

C on the other hand, doesn't have these problems. It feels very natural to interact with graphic libraries, and it's small and fast. Very nice. But it's instead often painful to code in. But in this case, I'm not convinced that the underlying platform is the problem. I think here there's space to fix the language instead.

For example, repl'ing is impractical in C, but I think you could fix that.The OS lets you modify your program while running, thanks to dlopen -- loading dll / .so-files during runtime. Immutable data is nice for flow, but not necessary for games (though you probably want to peek a lot at some of the benefits you get from immutable data, like being able to express that values put into a function doesn't change, like non-mut parameters in that unnameable oxidizing language). Paredit? Just make the language a lisp and it'll be fine. Libraries that seldom move? This is more of a culture thing, but I believe focusing on functions over classes help, since functions are easier to add more of. E.g. you could update a library by adding a foo2 rather than modifying foo, then let the user of the library either use the old one or the new one. No breakage.

So this is what I'm trying to do with vajer. Sadly I'm currently coding it in C, and I'm not a very good C programmer, so I am a bit stuck. So instead of trying to solve it, I'm writing some more blog posts.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Casey Light Light

This post is very sad, and might be uppsetting for you. So I've created a subpage for it. If you don't want to read about something sad and personal, you shouldn't read this. If you still want to read it, press the link below.

Casey Light


Type inference in Vajer

Type inferencing in Vajer works now!

This means code like this:

(defn move_up
  [map mapw maph]
  (var pos (get_pos map mapw maph 0))
  (if (>= (- pos mapw) 0)
    (move map pos (- pos mapw))))

Is compiled to

void move_up(int* map, int mapw, int maph) {
  int gensym54;
  gensym54 = get_pos(map, mapw, maph, 0);

  int pos = gensym54;

  int gensym56;
  int gensym57;
  gensym57 = (pos - mapw);

  gensym56 = (gensym57 >= 0);

  if (gensym56) {
    int gensym59;
    gensym59 = (pos - mapw);

    move(map, pos, gensym59);

  }

}

!!!

It's of course hideously untested and the error messages are terrible, but it's really cool that I can now run compile and run my game, with code that looks quite a lot like lisp! :D

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Less wonky if in Vajer

Last time I wrote about Vajer, I had to write if like this:

(defn move-up
  [map :char*
    mapw :int
    maph :int] :int
  (var pos :int (- (strchr map 0) map))
  (if (>= (- pos mapw) 0)
    (do
      (put map pos 1)
      (put map (- pos mapw) 0)
      0))
)
    

Because it couldn't deal with void. Also it could only deal with ints.

Now that's fixed! The same function now looks like this:

(defn move_up
  [map :char*
    mapw :int
    maph :int] :void
  (var rrr :char* (strchr map 0))
  (var pos :int (- rrr map))
  (if (>= (- pos mapw) 0)
    (move map pos (- pos mapw))))
    

Now that I look at it, it seems some other things changed, but the important one is that I don't need :int return type on the function, and the if doesn't need the do-block and returning an int!

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Would You Hire Yourself?

As is usually the case when I am tired but get time to lay still in bed all morning (not that common with a 6 year old son), my mind starts visiting interesting places.

When I am stressed, it's sadly mostly about work. But lately, it seems that those processes have slowed down. Perhaps because I got fired from the last job I was stressed at. My current work feels more manageable, and I'm able to exercise 5 times per week.

This morning, one of the interesting things that popped up was the question "would I hire myself?". Something struck a chord when I "heard" this, and I think it's sort of an interesting question to explore.

Since the economy was rough in the last company I worked for, I got the "ephiphany" of: for every crown you get paid, you should earn your company two crowns. If you can't do that, you're probably not working in an economically sustainable way.

Since then (a full two months ago) I've started to ask myself this before considering working with someone: will I bring more than I cost?

I think the way I'm working right now, that's definitely true. I believe I am adding a lot toward the goals of the company, which are also things people are willing to pay for.

The "would I hire myself?" question is a bit broader though. Because with that framing, one gets a bit of company culture, morality and personality traits into the mix.

I've struggled a lot with reporting time, because if you judge me by "how well do I sit in front of a computer 40 hours per week and have the job's code open in my editor?" I'm a terrible programmer. I have a kid who gets sick often, I'm a feminist which means I want to share household work (and there are hints that this is good for the relationship as well (which seems kind of obvious but also seems like many men don't bother)) some of which includes dropping off my son at preschool and making sure dinner is ready. So if the above criteria is how I'd hire me, I would say no. Never. I'd just hire someone fresh out of college (or still in), give them 50% of what I ask for, and they could chug along merrily with all of their youthful energy and boundless time.

So what I've done then, though not stated explicitly, is something like asking myself, "ok, so in what situation would I hire myself in?". What I came up with is something like this:

  1. I need to be able to take care of my son when he's sick
  2. I need to drop him off at 09:00 and be done with work 17:00, and I need to exercise and eat lunch inbetween
  3. I need to be able to have tired days
  4. I don't want to deal with people planning that I should do x thing on precisely y day, which always gets wrecked because of someone getting sick

What I came up with then, is that I should work at most 4 hours per day. That would mean I have 8 hours - 4 hours = 4 hours to be lazy and exercise. What this also means is that if he's sick one day, and my wife takes care of him the next, it's at least feasible (if hard) to work a bit longer and catch up, whereas with an expected "8 hour in front of screen per day", catching up and doing 16 hours is impossible for me.

With this in mind, I can proudly answer the question of "how well do I sit in front of a computer 20 hours per week and have the job's code open in my editor?" and say "very well!". Even with life's hiccups, I can do that pretty sustainably.

Now, what I haven't even started getting into is what other questions I could ask myself, which are a different way of looking at the problem, questions that would make me look better than less experienced developers.

"How well do you manage unclear specifications?" No problem.
"Do you enjoy mentoring others?" Yes!
"Can we put you alone in a room with a client and you'll figure everything out and deliver a product without essentially any hand-holding?" Hell yeah! I love talking to clients and users and all that stuff. I love making sure users enjoy using the tools I build for them. :D

With these criterions, and still having fulfilled the nebolous "can you sit in front of computer x amount of hours" for a high enough number of x, I can proudly say:

"Yes! I would hire myself!"

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


When is long term planning needed?

I often dive into things head first. I like to fix problems, code as quickly as possible while I'm still hype, I hate waiting. I really really hate waiting. Because it's like spending my working time doing nothing. Then when it's time to do something I'm already tired and/or bored.

So I tend to do things one bit at the time.

When I started working on my text editor freja, I didn't sketch out freja-frp, freja-layout and textarea. I just started with the goal of "implement all interactions that are in the Chrome implementation of <textarea></textarea>".

This turned out to be a great goal. It's very clear what should be there. Everything in the Chrome textarea. And it's very clear what should not be there. Everything that's not in the Chrome textarea.

Another helpful part was that I constantly communicated my progress with a close friend. So even on non-productive days I could complain about the problems I faced. I can't remember if he did, but I'm sure he brought up interactions I didn't think about at first, like triple clicking or certain funny word wrapping aspects.

After two months or so, I was at this stage (youtube, 1min). At that point I even managed to get some extra stuff in, like syntax highlighting. And a little easter egg for those with a watchful eye. :)

Still, after those two months, I still didn't know what was ahead of me. I had just worked merrily in a way that suited me. I had this vague sense of what an ideal text editor should be, but I didn't say that I must plan everything out ahead.

Then, about a year later, working in a similar way, with smaller problems to solve each week, I released what I call the notepad-complete version of Freja. You could essentially do everything you can in notepad, and then some (live coding in the editor!).

I believe I would never have gone this far if I had tried to plan this process ahead. And this is for a whole text editor. I wonder how many ideas are snuffed out before getting the chance to burn brightly, because of inaction.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Zoom In Teaching

I just read this blogpost by lawik. lawik is a fellow Kodsnackare who apparently has a really cool blog.

I've heard that it's good content to take someone else's stuff and comment on it, so I figured I'd do that.

lawik describes how one can zoom into problems infinitely. Like in the following paragraph.

When a student asks me “What are your thoughts on MongoDB?” the answer is only simple if I lie. I know some people like it. I have heard enough to distrust it. The answer “Just use Postgres” isn’t exactly right, “It’s probably fine” feels dishonest and if I add “but I’d never choose it for anything” that’s hardly helpful. There is enormous context and choosing what to bring into a learning person’s world is genuinely difficult.

I've done a little bit of teaching myself, and have struggled with similar problems. I myself love diving into weird little details, like how Axl's crouching kick can avoid Sol's massive overhead Bandit Bringer in Guilty Gear Xrd. Or how in Clojure you can access private functions, like clojure.core/into1 with the invocation @#'clojure.core/into1.

These are things obviously not relevant to a beginner, but on the scale of "this is how you call a function" to "this is how you modify core functions" one always have to come up with an answer to: "do I explain this, make some vague analogue up, or ignore it?".

It doesn't help that you often have to do this while solving your own problems as well.

For me, the two things that have helped me teach others are:

  1. Dedicate time to teaching
  2. Teaching in a workplace setting means working together

The most succesful situation I've had was when I described an interface for a Wave Manager in a game. It was meant to keep track of the number of enemies, and when the next wave of enemies should spawn after all enemies in the current wave had died.

So I would write something like:

// 1. count number of enemies
// 2. if count is zero, start a timer
// 3. if timer is complete, call SpawnNextWave
void CheckNewWaveStart() {

}
    

And then I'd do the same for SpawnNextWave, and for the next function that popped up, etc etc.

Then I said that he should implement the functions, while I work on another related but not super dependent interface.

After doing that for an afternoon, he said it was the best work day he had had so far. So it worked great!

I think what was helpful about this was:

  1. His focus was more clear. He was not supposed to design an overarching structure, but was instead supposed to solve more zoomed-in problems.
  2. He was contributing. It was stuff that was crucial for the game to work.
  3. I could work on other things, related but not dependent, so I wasn't as slowed down as I would have been if we worked on the exact same thing or wildly different things. This helped my productivity and lessened context-switching.

I have more things to say about the blog post, but this already turned out pretty long, so that's it for today.

Thanks lawik for sharing your thoughts.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Boulders

Somehow I managed to get a game of some sort working in my lisp. :D You can move around, collect money, and most importantly: die.

There are some interesting quirks. For example, you can only use if as the last expression in a defn, or inside while. If you do it inside a while though, you can only use if as a statement, and not an expression. Hm.

(var lul :int 0)
    (while (< lul 1)
      (if (&& (== 0 (in map to))
              (< to (* mapw maph)))
        (do (printf "YOU DIED\n")
            (set dead 1)))
    (set lul 1))
    

So there's some of this littered around.

What's nice is that now I have an example program, stored in git. So now I can go through various pain points (and I've written some down in QnA.md). Then over time I can compare my progress to this initial program, and see how much cleaner newer versions of vajer will be. :)

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Vajer Progress

Today I was able to create a character that can move around on the screen. Code

Some reflections:

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


<untitled>

I just don't know what to write about.

My mind is kind of spinning, due to lack of sleep and things.

Right now I'm waiting in the smell of stone grilled bread for my gluten free pizza and my wife's vegetarian avocado salad to be made by the men behind the counter.

I'm trying gluten free food at the moment, and for the last two weeks or so. I can't remember if I wrote this already, but if I forgot it, I'm sure you did as well.

The first inkling that I might have some problem with gluten was the way I felt after eating Max's plant beef burger, which I'm pretty sure is made with wheat. After eating one of those bad boy's I was knocked out for an hour or three.

It has felt very inconsistent though, like I didn't feel affected when eating bread or pizza etc.

But after one tired day too many, I figured I need to try something. I can't remember exactly what made me try gluten free, but I think one part of it was vaguely remembering my mom saying felt she felt much better when not eating bread and stuff.

So I just tried it.

The main difference in my life has been going from 4+ sandwiches per day to 0. I've had to cook more stuff for breakfast, like eggs and pancakes using almond flour.

It was kind of funny, I had no real clue what almond flour was. I thought it was some strange stuff made in a lab for gluten allergic people.

But then I read the back.

It's made out of almonds.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Late

Today is the first time I failed to post a daily blog before 24:00. :O

I managed to make a @ move around with my lisp and sdl, so that was neat.

I got to rebuy a mod for minecraft for my son, because we had bought it on my account before.

My wife and I started watching a new series that is surprisingly good: "Kärlek och Anarki".

The machines are beeping and whirring. Some of it is comforting. Other sounds more grating, or even shocking sometimes.

I hope the whizzes will lull me to sleep.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Back Exercises

Today was a pretty strange day, so here are my top three back exercises. Please be careful and listen to your body, I have no clue if these are for you, so try them at your own peril. I got them from a physical therapist though, and I believe they are fairly gentle.

I don't know their names, so I'll just name them something.

The band puller

  1. Put a rubber band under your right foot
  2. Stand straight
  3. Put your right hand forward, at the level of your hips
  4. With the hand in this position, adjust the band so that it is just starting to stretch
  5. Pull your hand and the band upwards, so that your hand pointing straight forward, at the level of your shoulder
  6. Slowly move your hand down to the starting position
  7. Repeat 5-10 times, then change hand and foot. Do the same, and repeat for a total of 15-30 times per side

Progression: Use a rubber band with more resistance

Super Person

  1. Stand on all fours, hands under shoulders, knees under your hips
  2. Lift your right arm, hold it straight forward, in level with your head, for a breath, then put it back down
  3. Repeat with your left arm, then right, etc, for a total of 5-15 repetitions per arm

Progression: Increase the number and length of your breaths Next level: Straighten your left leg, point it straight back, when you lift your right hand

Super Person Image from https://www.sweat.com/blogs/fitness/bodyweight-back-exercises

Spine-into-floor-pusher

  1. Lie down on your back, with your feet a bit away from your butt, so that your legs make a sort of triangle
  2. Push your back into the floor. You'll want to use your "core" more than your stomach, you can verify that you're doing this by feeling right above your pelvis, especially to the sides. You should feel muscles tense here
  3. Hold that position for 5 breaths, then release
  4. Repeat 10-20 times

Spine-into-floor-pusher

Progression: Keep one leg straight forward, and lift it ever so slightly above the ground. The lower you keep your leg (without touching the ground), the harder it will be

These exercises help me a lot when my back hurts. I hope they can be helpful for you as well. :)

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Little Green Line

Today I made a green little line.

Little Green Line

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Balancing Input and Output

I watched a video about art one time, making art, that is. As I remember it, the video person said that one problem people can have is that they are doubting themselves. And one reason for that doubt is that they know a lot, but can only execute a little. This can happen when you watch a lot of tutorials on "how to do things" (like art), but don't spend enough time experimenting with the information you gathered. This builds up a huge discrepancy between what you know, and what you can do.

The video person gave a concrete ratio, I can't quite remember, but it was something like watching 20 minutes of art tutorials should be enough for at least 5 hours of practise, or maybe it was 20 hours.

I wonder, with tech, if the ratio isn't even worse. People are still debating SOLID principles, while I still feel pretty undecided about it. I haven't put in enough hours coding using those principles, or without, and compared them, to actually have a solid opinion. And I feel this way about:

And this is just basic stuff. How about which way to structure your code? What language to choose? Static vs dynamic typing? (You aren't allowed to have an opinion on this unless you've tried Idris.)

Okay, so, yeah. Whatever. This technical stuff is kinda getting in the way of the point I want to make. Which is this.

I think it's good to find a balance between input and output. If I have too much input, I'll just become an armchair expert, and those don't get anything done and everyone think they're annoying.

I've become more aware of this problem while trying to use the GTD tools. Like capturing all ideas and potential tasks. Now I try to listen to a podcast episode, or watch a talk. But just the amount of things I write down gets exhausting. There are so many good ideas in the world, and so much to explore. But I already have a ton of things to do and explore! I don't really need more ideas at the moment! I just need to output more. And in the meantime, I'll try to find more meaningless ways to rest, less draining than watching talks or listening to podcasts where my brain just fills up with more stuff I don't have time to try.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Exercise and ADHD

I wonder how much less people with ADHD would suffer if they got sufficient exercise.

I feel both anxiety and sleeplessness decrease when I exercise.

I read that when children get to exercise that got their hearts going as little as 5 minutes in the morning, before classes, they were better at focusing.

I wonder how many get medicated when maybe they should just get a chance to exercise more.

I'm sure some people need medication, I just wonder if there are enough economic interests in getting people to move around more.

My back pain is eradicated after I jog/walk/jog for a bit. It's very nice.

I'm happy I can move more now.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Compiling Lisp to C

Today I got some time to work a bit more on the compiler. It's been a two week break, mostly because of focusing on GTD stuff, having meetings with work people last week, my wife going to Stockholm for a couple of days, my wife being sick, me trying to actually do the stuff I wrote in my Orthodox GTD Journal.

I'm pretty happy though, because my home is surprisingly clean, and I finally ordered a portable laptop stand that I've been wanting for years. I've also bought a Planck EZ from a nice guy / super star (perhaps most famous for his shorts video). When it has arrived I'll proudly take a photo of my glorious set up. Did I mention I bought wooden wrist support as well?

So, with all that sort of figured out, I finally felt the peace of mind to sit down with my lisp again.

When I last left of, I had almost fulfilled the goal of compiling

(defn fac [n]
  (if (<= n 1)
    1
    (* n (fac (- n 1)))))

to

int fac(n) {
    int res;
    if (n <= 1) {
        res = 1;
    } else {
        res = (n * fac(n - 1));
    }
    return res;
}
    

The stuff that was missing was:

  1. Figuring out what should get a ; at the end (e.g. not if)
  2. Calling user defined functions

I fixed 1. pretty easily, thanks to having both thought and talked about the problem with my friend. 2. was pretty easy to, for now I just assume people fill in the right names for everything and try to call it.

After that, I got it to compile it to C and run the resulting source in the same process using libttc. Very cool! :D

I did know there were some problems though. So after the initial success, I wrote some down:

I decided to tackle types first, and thanks to the great resource in janet's cgen, I figured I could just use explicit types for now, in the ast having the form of (int num), so a defn would look like: (defn add [(int x) (int y)] int). I thought I could make it look a bit nicer in my source, so I decided on this syntax for now:

(defn strlen-plus-n
  [str :string num :int] :int
  (+ num (strlen str)))
    

Of course, the goal is to add type inference later, but since the C ast will need the types explicitly, to make sure that worked first, it felt easiest to start with explicit types.

Anyway, after hacking just a bit, mainly changing how defn ast nodes are transformed (specifically the arguments), I managed to compile the above to:

int strlen_plus_n(char* str, int num) {
  return num + strlen(str);
}
    

Yay! :D

Soon I might actually be able to compile enough C to write a little program. :)

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


First Day of Work

Today I had my first day of work. Doing the new work.

It felt good to know that I can work and get an income again. It's nice doing not much at all, but even nicer to do a little bit of something, and then nothing at all.

Today nothing at all meant getting home early to make surprise dinner for my wife. She seems happy. My son is with his grandpa. It's strange how rare a walk to the library together with my wife can be.

I don't understand how you're meant to work a lot, and have children, and take care of your body. Yesterday I managed to reach my goal of jog/walk/jogging for 30 minutes, which felt great! But I would have had a hard time doing it if I weren't able to spend part of my work day exercising. Evening time is so chaotic and prone to random events, that it's hard to make a habit of anything, at least for me.

So I'm very grateful that I'm able to take care of my body better.

I've heard that police and firemen get to work out during work time. I wonder why the same isn't true for programmers?


The Purge

Today we purged my son's stuffed animals. I wanted to write about the fun system I came up with, with dice to rate which animals he liked the most. He seemed to like assigning numbers to the animals.

But in the end, he still cried.


Fruits of GTD

Yesterday evening I took the time to sit down with my action-list, specifically the one called "At Computer". And I finally felt relief.

But relief isn't the right kind of word. In the GTD Fast seminars, David Allen talks about how you don't think, and just do. And I actually felt that way. I just plowed through action after action, and when I was done, I had scratched out over 20 entries, some of which were pretty big (in my mind), like doing taxes. Others had been needing tending since august last year, but were now made progress on in minutes.

So yeah, that was pretty cool.

I don't have that much to say about it, other than I felt that the earlier steps really helped turning the productive phase super productive. Less figuring out what to do, more doing.

This post feels super boring, but I'm gonna practice publishing boring things as well. Because I might be wrong.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Catching Up

Today I finally got the time to sit down and go through my inbox. My book is now filled with tasks and actions.

Trying to get to this point has made me think a bit about doing things, and time.

It's interesting how much time is spent doing things that doesn't feel like you're doing anything. For example, today I woke up at ~8:00 and the clock was 11 or so before I felt I could sit down with my lists. The time inbetween felt like I did nothing, but what I actually did was:

And I'm probably forgetting details, like getting dressed, fetching a towel, making new sections for my action book.

It's just so much stuff! No wonder I feel pressed for time sometimes. It probably doesn't help that I can take some time switching between different contexts. My wife says it's because of autism, I claim it's because of being burnt out. Maybe we're both right. :)

Now my inbox is empty! Or, well, almost. I noticed I had another note in my pocket, but that one doesn't count because it wasn't in my inbox yet. So good enough!

Now I need to find time to actually do the actions.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Good Things Come in Pairs

Yesterday was an interesting day. After a bit of a struggle finding a nice place to work, I suddenly got two offers on the same day! One working with a game made in cljs + react native, which is kinda silly how good of a fit it is for me. However, the other offer was more stable, paid more (i.e. allowing me to work less, 15h/week(!!!)), and feels very meaningful.

So I chose the latter.

I think it's funny how common it is for me that when I struggle with something, and try to find a way out, it is often the case that after a time of panic, two solutions arise at the same time. It has happened multiple times with both love interests and jobs. Maybe it's a way to ensure that you suffer a bit as well, even in your time of luck? :)

I feel a bit bad for the cljs guy though, so if you are or know of someone interested in cljs + react native + gamedev, please contact me.

I'm very grateful that things seem to be turning out smoothly. Now I'll be in a good shape both economically and stress-wise (15h / w!!!) to receive our second son in august. ^_^

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Day 4 on GTD

Since starting to note everything down, as per Orthodox GTD Dogma, I'm realizing I have way more obligations than I thought. In a single day I noted over 20 things for my inbox plus email plus texts. And I don't even have a job!

A sample of things in my inbox:

It's just a lot of stuff!!

And I have even more already that has undergone the holy ritual of "processing", which means they are deciphered into "Goal" and "Action", and are under categories such as "At Home" or "By Computer" or "Projects".

Oh great, I just found another note. 10 more things, so 30 for today.

I'm a bit happy to get all these obligations down on paper, but I also notice I feel stress that it takes so much time to just process all of these notes. I hope I'll reach a point when there won't be too much new stuff, and I can spend a bit more time actually doing some of the actions I've written down.

What are your experiences with GTD or similar systems?

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Tenth Post!

This is my tenth post! I can't write much because my day got taken over by:

  1. Fixing the blog so it's more readable on more devices
  2. Talking with Fredrik about code and stuff
  3. Talking with people who might give me money to write code
  4. Going through a giant list of notes I've collected trying to implement GTD system

Now I'm gonna go make gluten free pizza and play LA Noire with my friend.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Getting used to bad things

I think there are more people than me who are good at getting used to bad things.

I used to code lisp in emacs, and what's amazing about it, is that you can use Paredit (and other structural editing tools, like those built into emacs) which let's you treat the code like a branching road where you can move towns and lakes around, rather than erase individual characters. The most obvious example in my mind are languages where , separates "things", e.g.:

int sum(int curr, int acc)

In this situation, if you want to switch the place of int curr and int acc, you have to do this awkward dance of selecting acc, cutting it, moving the cursor to curr, paste it, select curr, cut it, move the cursor back to where acc used to be, paste. If there were no ,, at least you could just select and cut the whole int acc, move the cursor to right after (, and paste, hit space, and remove the trailing space at the end. There are many variants on this, and if you're anything like me, you notice when these awkward things happen. And there's not really a clean solution.

That's not true in lisp.

You just do a single command, transpose-sexp (preferably bound to a hotkey). And when you want to move multiple expressions that are in the same block, let's say you have code like this: (curr :int acc :int), then at least you can stand in the middle, hit Ctrl+K which cuts until right before the closing ), then move to the beginning of the expression, then paste. At least you don't have to fiddle with selecting single characters.

But I've gotten used to not having it, after sitting in C-based languages for more than a year. And it's very sad.

Of course there are a lot worse things to get used to, like depression, abuse and plastic accumulating in our nature.

Still though, I wonder if there's a connection. If you allow yourself to get used to one thing that you can affect, but don't. Do you get better at getting used to bad things?

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Productivity

I wanted to name this Tired, but I already made that post, so let's do something else.

During the weekend, I listened to 90% of the second episode of Synk. In this episode, Fredrik and Martin talks about productivity and productivity tools (like papers and pens and Obsidian). I don't care about productivity, I just wanted to listen to them talk about something that isn't game development, because I've spent the last 5 years of my life listening to game development podcasts.

One of the things I like about Fredrik is that he tends to question things. So when he said he didn't necessarily do Orthodox GTD, but still enjoyed these seminars by the author of the GTD book, I was intrigued. I want to listen to people talk, and here's a person I like hearing talk saying I should listen to this other person talk. So I did.

First, the speaker (David Allen), feels very chill. I thought he'd be a stuffy business person, something I felt when trying to listen to Eat That Frog (some other productivity book thing). So it's just enjoyable to listen to him.

Secondly, his focus on being lazy, and that you should be able to enjoy all of life, not just work, made me feel that maybe he has something sensible to say.

So I kept listening for a bit while jog/walk/jogging today (maybe half an hour), and I'm still feeling "nah, I don't need this productivity stuff, my memory is doing all right. the important things are always in front of me". But with his comment about "collecting notes" still ringing in my ears, I start noticing all the little problems at home that I have some intention to solve, and have not solved. Here's a sample:

Of course, all of these things are in front of me from time to time. But I don't keep them in mind for when I have time to deal with them. This is obvious stuff, but I have felt so anxious about having todo lists that I don't have time or energy to go through, that I've convinced myself the best solution is to have no list at all. But I'm starting to come around to the thought that I might be wrong. Maybe it's better to have the lists, and even if I haven't solved everything, at least I can think: "well, it's on the list, and when I have time and energy, I can go through the list and solve it."

I don't need to keep it in my mind.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Rest Day

Today it is sunday.

For a while, I tried having a rule that I shouldn't code on sundays. I had this feeling that I was tiring myself out, and not giving myself enough time to recover. Sundays felt very boring, and I was often tired. Implementing this rule, it felt worse. Now I had nothing meaningful to do. And since I was tired, I had a hard time coming up with things to do. But over time, I started to appreciate this tired feeling.

As long as I don't fight against it, it's not dangerous. It's just there. And since I'm not allowed to code, there's not really that much actually hard things to do. I can clean the kitchen even if I feel sluggish. I can watch youtube with my son.

After getting laid off though, I felt pressure to create a game quickly, and tried to spend as much time as possible on it, including sundays. In the beginning, it was pretty easy. I got some sort of energy rush after being laid off. But then it went as with most projects, after three weeks or so, the hype died down. Me and my family got a long bout of colds and infections in the middle of it as well, so it wasn't really feasible to struggle so hard to create something quickly. My wife also commented on that I didn't seem as happy, now that I was working on sundays as well again.

(In case you're wondering, it was supposed to be a hexagonal, berlin interpretation roguelike with trains. I played a bit of Caves of Qud which inspired me to try to create something with less graphics and more code. However, I quickly ended up having to draw a lot, which meant I spent a lot of time not making fun gameplay. I think this helped kill my motivation.)

After letting myself just enjoy empty days, rather than forcing myself to produce, I've felt that I've started to recover from my last job. I think I was more stressed than I realized, and since I experienced burn out (with sleeplessness and extreme difficulties concentrating) at my last job, I imagine I'm more stress sensitive than most.

I've recently managed to jog often as well. I've been wanting to jog for about ten years, ever since reading Murakami's "What I Talk About When I Talk About Running". I never found a way to do it sustainably though. In the beginning, I just tried running for about 10 minutes straight, then increasing by 1-2 minutes every day. I think I lasted two weeks, then I started getting a lot of pain (I think in my knee, but I can't quite remember). I tried taking a short break, but it felt like no matter how long my break was, the pain instantly came back. Knowing myself as a 22-year old, I don't think I had the patience to wait weeks or months, and try again. So I quit, for many years. I've tried from time to time after that, but due to my EDS various parts of my body are very sensitive, e.g. knees, feet and my back.

But this year, I think I finally found a combination of things that actually work. I'm using Hoka shoes which have bizarrely large soles (I tried flat shoes with very little soles before that but it didn't work for me). I'm also doing the "Run/Walk/Run" thing, which for me meant in the beginning to stretch, walk for 5 minutes, do 10x 20s jog, 40s walk, walk for 5 minutes. Now I'm up to 22x 30s jog, 30s walk, and I've managed to keep it up even after getting sick, which is incredibly motivating for me, because getting sick tends to break all my forming habits.

I think this newfound ability to jog has helped me a lot in my recovery. I sleep well, despite now being completely sleep medication free. I also don't get as sensitive to days when I sleep worse. So overall my mood is better.

Then I ended up listening to the Kodsnack episode mentioned in my first blog post. And they said people should just start blogging. So I did! And all of a sudden my brain started connecting things again, I could think more clearly, and deeper than I have been able to for a while. So of course I start coding again. My motivation got an extreme boost, and now I feel like I have the capability to pull through. What's best is that I have no illusion of being able to make money of a niche programming language (well, I guess one can hope, but there isn't as much buzz as with games). I believe this helps me feel that this is more of a hobby than a job.

Still though, I don't want to risk my newfound energy. Therefore I resolve to not code on sundays. That way, I will at least have one restful day. And I'm also going to try not to write about code on sundays. I can write about my feelings about code, but not get into technical stuff.

Hope you'll also enjoy a restful sunday. :) My and my wife gonna get to watch my son's first dance performance, so I know I will!

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Time

It's hard for me how to know how to spend my time.

Sometimes I feel like I spend too little time with my son. At the same time, I think it can be hard to get all the things done while also getting time to spend with my son. And even if I get time to spend with my son, it can feel hard to find time to spend with my wife. And if I get both of those, it's hard to find time to spend with my wife and son at the same time. And then someone get's sick while we're at the playground. And now we have even less time to go buy food. So they eat leftovers, and I boil some rice. But now it's the day after that day, and now I have to buy breakfast before I can eat breakfast, and now I get less time to spend with my son.

Also I spent two hours watching this fascinating lecture about performance in programming.

#100DaysToOffload - Please say hi on mastodon.social/@saikyun. :)


Tired

Yesterday I had seemingly endless amounts of energy. And today I feel very tired. If this had been a regular workday, I would have been whipping myself over the lack of productivity. Luckily, I'm currently on paid leave, so I don't have to worry so much.

Until I start thinking about how I will soon die, of course.

In the face of that, tired days can really feel like a waste. I think I've come up with a spell that helps though. What I've thought is something like this:

With this in mind, it doesn't matter if you are tired one day, because the striving toward getting good at drawing is worth it anyway.

And if it isn't, you should probably quit.

#100DaysToOffload

Please say hi on mastodon.social/@saikyun. :)


Making a Lisp in C

Today I started working on a lisp in c. I want the lisp to compile to C. I've tried it before, but the first time I got stuck on figuring out what types things should be (assuming I don't want to fill out all the types all the time in lisp). Since then I've done some basic work on unification / type inference. When I tried my first lisp in c, I only found research papers about unification, which I had trouble understanding. I wasn't sure how to learn how to read them either, and ended up listening to Tractatus Logico-Philosophicus. It didn't work very well in audiobook form, and it definitely did not help me understand how to read science papers with strange symbols.

Since then, a friend showed me https://eli.thegreenplace.net/2018/unification/ which talked my language a lot better. So I was able to do the basic stuff, finally.

I did start on another lisp in c after writing that unification stuff. While I did manage to compile some C from lisp, I got a bit stuck trying to figure out how enable macros (i.e. running lisp while still being in the compilation phase). At least I think that's what happened. I started some work on doing both eval and compile, i.e. an interpreter and a compiler. But it seemed like I would have to write a lot of the same code over and over again.

What I've figured out now is that I somehow want to be able to:

  1. Compile lisp code to C
  2. Evaluate lisp code while in the compilation phase, using the same code as step 1. does

This seemed tricky, since I didn't know of a way to get eval for C. Then I remembered that my friend told me about tcc. tcc is a tiny c compiler, that is easy to build and bundle with your project. Even in the 2nd iteration, I figured I'd use tcc to generate dlls to facilitate live coding. What I didn't realize back then, but figured out now when reading the docs, is that you can use tcc as a library, and compile functions to memory.

I tried that. It's very awesome. Suddenly you have eval in C.

This means that if I encounter a macro during compilation, I can call some libtcc functions, and get some results, and then use those results when continuing compilation. Pretty cool!

I'm also guessing it'll make live coding ever so slightly faster, since I won't have to start a separate process, compile a dll/so to disk, dlload that dll, e.t.c.

Third time's the charm

So now I'm starting again, this time using only C, and trying to make sure everything works with tcc. Sadly I had some problems building binaries on my macbook air m2, but tcc -run does work. So hopefully it can be sorted out.

Ofc what I probably "should" do is either use llvm, or go all the way and just interact with assembly directly, but both those have their problems.

First off, llvm just seems to have slower compile times overall than tcc. Of course it then wins hugely during runtime, but that's not important for eval. My language should be able to AOT compile as well, and then I'd use clang / gcc / cl. But when coding, I figure tcc will speed up development a lot.

Doing something with assembly, instead of having the middle step of C, appeals to me a lot, but I know next to nothing about assembly, while I can do basic stuff in C. And even if I were to learn some sort of assembly, I would be tied hard to whatever platform I decided to learn. With tcc it seems feasibly to build/eval on all desktop platforms, and maybe the browser and phones.

And since my language will build to C in the end, I figure that when you're done coding and want to build binaries, it should be possible to build them for all manners of platforms, including consoles. You lose eval, but while it's a bit boring to lose it, it's not as crucial as it is while developing.

So far I've built the tokenizer. Not much to look at yet. But hopefully it won't be too long until I can call some C functions using my lisp. :)

#100DaysToOffload

Please say hi on mastodon.social/@saikyun. :)


Coding with ChatGPT

After I played around with wasm yesterday, I talked to a friend. He got me inspired to try some ChatGPT coding. I started out making a lisp parser in rust. It turned out pretty well, after some massage and asking it to change things. For example, it used &str without explicit lifetimes, which Rust didn't like. I could tell it to add the explicit lifetimes though, but now the code looked disgusting.

I bought the premium version and tried gpt4, and it instead used String (which seems sensible, and looks a lot nicer), but now it did tokenizing and parsing at the same time, which makes the code raise my upper lip in disgust.

It's a very different feeling from hand coding things. Like pushing a river. You can affect it, but it's hard to control, and sometimes you get chaotic whirls that the compiler and I don't like.

After the lisp parser, "we" made the evaluator. At first it had a big match where it would put functions like + as a case. But I wanted it instead to look up symbols in an environment, and have certain symbols be added to the environment by default. I asked it to do this, and it actually rewrote the code. That was pretty cool! Still some manual labour on top, but it's the sort of change that can feel hard to switch to, when you've already coded in a different style.

I should mention that from nothing to evaluator took about an hour. I think that's faster than I could have written it by hand, and it's definitely faster than it would have taken me to write it in Rust, since I'm a bit rusty.

cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/lisp`
List([Symbol("+"), Number(1.0), List([Symbol("*"), Number(2.0), Number(3.0)])])
Result: 7

I tried some other stuff, like generating example Clojure code to use as a test, something to implement in my own lisp. It was kind of hilarious, because it missed a closing parens. Even AI can't write lisp. :') Paredit ftw. If you haven't checked out structural programming at all, I recommend just looking at those beautiful gifs.

One thing ChatGPT has over me is how quickly it can switch between different tasks. Despite me feeling tired, I felt that I could get a momentum boost by seeing it's code, wether it was correct or not. It's like giving me a space where it already has filled out the little calls that I might have forgotten (how did I split a string with a regex in Clojure again?). It was also nice to get some Rust examples, since I haven't used it in 6 years.

After that, I tried making a card game using TypeScript. I started out having it give me examples using canvas (e.g. a function that renders playing cards), but I quickly felt that I wanted some abstractions over loading sprites and handling user input. Maybe that was wrong, but that was how I felt.

This is where I felt chatgpt became very annoying to use. I tried to have it give me examples for using PixiJS, then Phaser, then P5. And over and over again it resulted in strange typescript errors. I'm sure there might have been configuration somewhere that's strange, or I was using old examples or something. But overall it felt really unpleasant, and took way too much time. It might have more to do with the TypeScript + npm + webpack/parceljl/??? combination that easily leads to a silly amount of things that can go wrong.

After getting over the hurdle of getting something to draw a rectangle on the screen (which ended up being easiest with p5), "we" started adding things like a deck, hands of cards, a play zone etc. It felt all right, but I felt a lot less helped than when it wrote the parser. My guess is that the parser is more well defined, and it's the sort of thing that's easy to get wrong as a human, while coding game mechanics has more to do with positioning things on the screen and moving things between different collections.

Another point for ChatGPT was asking for math with natural language:

Can you give me an easing function in javascript, that starts out slow, then fast, then slow in the middle, then fast again?
Yes, you can use the "easeInOutQuad" easing function in JavaScript to achieve the desired effect. Here is the code for the function:

function easeInOutQuad(t, b, c, d) {
  t /= d/2;
  if (t < 1) return c/2*t*t + b;
  t--;
  return -c/2 * (t*(t-2) - 1) + b;
}

This is the sort of code I could figure out, but it takes me a long time and I don't enjoy it. I believe asking it for help with vector math can come in handy as well.

The most important thing I learned, is that I enjoy coding a lot more than doing code reviews. So I'll probably keep hand coding for as long as I can. :)

#100DaysToOffload

Please say hi on mastodon.social/@saikyun. :)


Web Assembly

Yesterday I posted my first blog on Kodsnack's slack channel, and got some feedback on my woes about programming.

Some said that zig and r*** might be good languages to look at, and I argued a bit about how they appear to me as languages that doesn't have the same goals in mind as me. I think being able to (compile and) execute code with <200ms delay is important, since I find it pleasant when working on things like animations and layouts. Needing to wait even a second while modifying an animation feels painful to me.

I want to be clear and say that I do think zig and rust are interesting (and probably good) languages, and it's a difference in priorities and aesthetics, not in some objective "good"ness. So if you do enjoy zig / rust, please keep rocking on. :)

I also got some kind words about Freja, which I really appreciate.

The last thing that came up was the subject of WASM. Being interested in both web and games, I've been curious about WASM since it's inception. I still remember playing some Quake or DOOM demo in the browser, and it seemed kind of magical. I never did anything with it though, since at the time I was busy writing web apps in node and play League of Legends.

Last summer I started wondering if assembly is a good target for live coding, since it's very flexible (just swap out the byte code right?). It seemed very tricky to write a multi platform compiler though.

When camping with my family, I started reading about uxn, and pen & paper computing).

In the paper prototyping site, they mention that you can compute using a really small instruction set:

The following three counter machine models have the same computational power since the instructions of one model can be derived from those of another:

INC(r), DEC(r), JZ(r, z) - Minsky (1961, 1967), Lambek (1961)

CLR(r), INC(r), JE(rj, rk, z) - Ershov (1958), Peter (1958)

INC(r), CPY(rj, rk), JE(rj, rk, z) - Elgot-Robinson (1964), Minsky (1967)

With this knowledge, I made a assembly editor and interpreter using termux. It was pretty fun, and it really fulfilled the minimalist language that I envisioned. It was pretty cool that you see how the registers changed when you ran the program too.

Next step was obviously to make this compile to arm assembly. Arm is the simple one, right? Oh boy. I read a bit, and felt that I understand some, but it was far from my naive 3-instruction view of the world. And even if I understood enough, I realized I'd be super platform dependent, which doesn't feel very appealing.

I haven't touched or thought very much about assembly since then.

Back to WASM

With this in mind, the mention of web assembly came at an interesting time for me. I now knew that assembly computing could be pretty enjoyable, and I also had built up a need for a simple way to play around with assembly, but that was more flexible than uxn. While I think uxn is cool, I'm not sure I want the restrictions.

WASM seems pretty diverse to me, with a bunch of different projects going on. For my goals, this combination appealed to me:

I've just started (like 2 hours ago), but so far I managed to create a little example repo that I feel happy about. Check it out here.

wasmtime hello-world-wasi.wat
hello world

What I did was pull together examples from the projects mentioned above, and managed to run a program printing hello world in both the browser and on my macbook, using wasmtime. It's not much, but it's still cool to be able to hand write assembly code and have it do stuff and run on multiple platforms. :)

#100DaysToOffload

Please say hi on mastodon.social/@saikyun. :)


Thought loops

Inspired by Fredrik Björeman I decided to create my own blog. In his podcast Kodsnack he and Kristoffer talks about getting stuff out without thinking too much.

I felt this very hard, as I've been stuck in some thought loops lately. If I were to describe it as shortly as I could, this would be my attempt:

  1. I want to be able to create graphical applications and games, that can run on as many platforms as possible, with live coding capabilities

  2. To fulfill this, I created Freja, a code editor that can be modified withing itself, and therefore create GUIs and games without ever closing the applications

    2.1. Well, that was the idea anyway, but I still have problems like ending up in an infinite loop and needing to restart

    2.2. The bigger issue however, is that the GUI lib I wrote doesn't work well enough. Tons of tiny bugs that pop up whenever I try to create new GUI

    2.3. I also don't quite agree with the language I use, Janet, which is a super cozy lisp, but has some other ideas about live coding / redefining functions during runtime, which are not hopeless to overcome, but often a bit in the way. This is in no way the fault of the language, it just has slightly different goals than I have.

  3. Despair

  4. I've tried Unity and Godot, and while I dislike the former (extremely sluggish, and the minor point that C# feels like a nice, safe car but sooo boring -- where is my meta programming!?), I can withstand the latter. It's snappy and nice, has basic hot reload, but I personally feel the OOPiness (specifically no interfaces and tons of inheritance) makes for a less cozy environment for me.

  5. Now I'm standing here, wondering what to do with my situation. I feel like I don't have a cozy place to code, but I'm not sure I'm ready to rewrite the GUI library. I'm also thinking about writing it in C, a language which I've gotten a lot more love for, since learning that hot reloading DLLs is surprisingly viable. But C lacks some things I want (multiple dispatch, dynamic arrays). I've tried to remedy this with macros, but it still feels a bit icky. Like I'm trying to make the language be something it's not.

So here I am. I've experimented a lot, e.g. making C more dynamic (changing structs during runtime), compiling lisp to C, playing around with type unification. But I have no clue where to go.

#100DaysToOffload

Please say hi on mastodon.social/@saikyun. :)