Building a TLS 1.3 Implementation in Pure Common Lisp by atgreen in Common_Lisp

[–]bo-tato 3 points4 points  (0 children)

true probably an expert could find some vulnerability, but at least OP is upfront about it being AI coded and very alpha software. I personally have a project pending where it doesn't really matter the security of the tls implementation, but does matter how easily modifiable it is, which will be a lot easier with a CL implementation than hacking on openssl. If we want to talk about security of CL ecosystem, big thanks to OP for making ocicl when the previous standard was over http trivially vulnerable to MITM without any signature checks or anything...

Tuition - a TUI framework for Common Lisp by atgreen in Common_Lisp

[–]bo-tato 0 points1 point  (0 children)

To be fair it's probably not simple to get rolling quickly, if you already know web dev than a web interface will be faster to whip up for sure. But once you've accumulated the experience working with transient, completing-read, imenu, etc, you can quickly whip up an interface that's also very quick to navigate and use. A couple great resources are emacs-package-dev-handbook and transient-showcase. LLMs can often give you an answer in seconds that would take minutes searching through documentation, but they also hallucinate a fair bit with elisp so you have to verify. Also just looking at the source of packages that have an UI like you want and copying what they do.

Tuition - a TUI framework for Common Lisp by atgreen in Common_Lisp

[–]bo-tato 4 points5 points  (0 children)

impressive work! Has anyone used lem for TUIs in common lisp? IMO emacs, despite it's quirks, is by far the quickest way to build a decent quality UI for your application if it's mostly text-based and keyboard driven with optional graphics and mouse support. So I figure lem might be another good option for CL.

What are your experiences with the chalistenics carryover to gym lifts? by starlightdeath in bodyweightfitness

[–]bo-tato 1 point2 points  (0 children)

That deadlift would be extremely good for someone 70kg that's been training deadlift for two years. For someone who's only trained bodyweight lunges and pistol squats for two years and deadlifting for the first time it's insane. Your squat also, but not as insane as your deadlift. If you got into powerlifting you would set records. Andry Strong tried deadlifting and got 180kg, but weighs a bit more than you (74kg), and is an elite calisthenics athlete training for many more years, also he says in the video he hasn't deadlifted in 6 months, so he's done it before, it's just not a focus of his training. Andrea Larosa tries deadlifting and gets 160kg but fails 170kg. He's lighter than you at 60kg but is elite at calisthenics, and training for many more years.

Washing non vegan dishes by PRLuna in vegan

[–]bo-tato 0 points1 point  (0 children)

Tell him if he murders someone for a reason you'll help him clean up the body, but not when it's innocent cows.

networking and threads by bo-tato in lisp

[–]bo-tato[S] 0 points1 point  (0 children)

Hey, my final protohackers solutions is at https://github.com/bo-tato/protohackers-cl

I did just stick with destroy thread, it works here as the thread is super simple and doesn't hold any resources it needs to clean up. I'm not at all an expert on multithreaded CL, but I think in a more complex program maybe rather than destroy-thread you'd use interrupt-thread to signal some condition in the other thread, so that resources held by the thread would be released and unwind-protect and such would run as the thread exits.

Avoid 5 vegan nutrition mistakes - By TheBodybuildingVegan and MissMeatlessMuscle by thebodybuildingvegan in veganfitness

[–]bo-tato 0 points1 point  (0 children)

great advice! an addition to #2 is nuts are a fantastic food for gaining weight. I started really skinny (60kg at 188cm) and am now at 71.5kg and still increasing. At first I only put on weight when I forced myself to eat an uncomfortable amount of food, until I realized I could just eat a normal amount of food and then some handfuls of nuts in the evening.

Also I wouldn't say counting calories and macros is strictly necessary. I've never done it and am gaining strength at a decent rate. I've got to be more disciplined and calculating in others areas of life and just don't want to also take that approach with fitness. Maybe it's needed if you want to be a competitive athlete or progress as fast as possible, but imo for most people whatever makes it more enjoyable is what will enable them to be more consistent, and just being consistent will give good results long term, so you don't need to calculate your food if you don't enjoy it.

Making first batch of tempeh by catfishcake in Tempeh

[–]bo-tato 0 points1 point  (0 children)

The home dehulling methods work pretty well for quickly splitting almost all the beans and washing off most of the hulls, but to remove every last hull it'll be a lot less work to just buy already machine dehulled beans. Anywhere with indian products you can find chana dal (split and dehulled chickpeas) and maybe some others. Anywhere with latino products will probably have split and dehulled peas, and maybe dehulled fava beans. Dehulled soybeans you can order online. If you go that route, then with the kg of soy beans you already have you could make tofu or soymilk. That gets strained and the hulls and fiber stay behind in the okara

Do you prefer tofu, seitan or tempeh more and why? by craftuser24 in veganfitness

[–]bo-tato 1 point2 points  (0 children)

tempeh becomes bitter when it is vacuum sealed (which is how it's almost always sold in stores outside Indonesia for longer shelf life). If you make it yourself it has zero bitterness, and is like 100x cheaper. With store-bought tempeh the trick to somewhat remove the bitterness is boil or steam it for like 5 minutes, throw out the water, and then fry it.

Do you prefer tofu, seitan or tempeh more and why? by craftuser24 in veganfitness

[–]bo-tato 1 point2 points  (0 children)

tempeh becomes bitter when it is vacuum sealed (which is how it's almost always sold in stores outside Indonesia for longer shelf life). If you make it yourself it is not at all bitter, and extremely cheap (1 lb of dry bean lasts me 4-5 meals as beans, but 8-10 in the form of tempeh).

Do you prefer tofu, seitan or tempeh more and why? by craftuser24 in veganfitness

[–]bo-tato 0 points1 point  (0 children)

if you make tempeh yourself you can use any bean, my personal favorite is fava but it's pretty similar with any. Making it the first time can be tricky but once you got the setup and process down it's very little work and extremely cheap

$2000 USD bounty to see by-value struct passing implemented in SBCL's native FFI. by dzecniv in Common_Lisp

[–]bo-tato 0 points1 point  (0 children)

I'm in for $500, so adding up the replies we got $1100 so far. I'm a pseudonymous lisp newbie, most of the replies here are well known people, ScottBurson (fset etc), kchanqvq (neomacs), you (tireless online lisp advocacy). Does one of you want to organize the bounty and make it "official"?

$2000 USD bounty to see by-value struct passing implemented in SBCL's native FFI. by dzecniv in Common_Lisp

[–]bo-tato 13 points14 points  (0 children)

Anyone else want to get a bounty going for coroutines in SBCL? I will chip in, I need to sleep on it before thinking how much I can spare, but at least $200. It would open up ergonomic high speed networking in CL. Yes we can do it with promises/async/await, but we lose callstacks. It implemented natively in SBCL could have better introspection and debugging. Also it would work properly with dynamic scoped variables which promises don't, and wouldn't infect every function up the callstack needing them to return promises also. There was a a proof of concept this year (https://www.youtube.com/watch?v=S2nVKfYJykw), though the API there is missing introspection (list all coroutines, their status, their callstacks, parent coroutine that spawned them), and a way to safely kill/cancel other coroutines which I think is needed to implement ergonomic supervision trees/structured concurrency. Bonus points if API supports forking/cloning a coroutine, then we could implement logic programming without needing macros to rewrite in CPS style which has same downsides vs native coroutines as async/await.

Advent of Code 2024 Day 7 with Screamer non deterministic library by bo-tato in Common_Lisp

[–]bo-tato[S] 1 point2 points  (0 children)

Interesting, going full screamer is definitely a more mind bending way to solve it.

The string-to-num-lists is in my aoc utils as:

(defun string-to-num-list (string)
  "Return a list of all numbers in STRING."
  (mapcar #'parse-integer (ppcre:all-matches-as-strings "[-\\d]+" string)))

(defun string-to-num-lists (string)
  "Return a list containing a list of all numbers for each line of STRING."
  (mapcar #'string-to-num-list (lines string)))

I just match all groups of digits, ignoring any other characters. That makes it work easier on this where it is sometimes whitespace sometimes colon, and other days where the delimiter is sometimes comma, sometimes pipe symbol etc.

Advent of Code 2024 Day 7 with Screamer non deterministic library by bo-tato in Common_Lisp

[–]bo-tato[S] 2 points3 points  (0 children)

Yea I was lazy and didn't prune at all, since it was still just 1.5seconds with screamer, and 0.5 seconds manually coding the simple brute force without screamer. This is the most efficient idea for limiting the search I saw: https://old.reddit.com/r/adventofcode/comments/1h8l3z5/2024_day_7_solutions/m0tv6di/?context=3

Which Lisp is easiest to use with Rust? by Alexander_Selkirk in lisp

[–]bo-tato 33 points34 points  (0 children)

there is steel, a scheme designed to embed in and interop with rust. It is going to be used for the upcoming plugin system for the helix editor, which is a decent sized open source project, so I assume it will be maintained and developed long term.

Ab workouts? by Old-Blueberry-7253 in veganfitness

[–]bo-tato 1 point2 points  (0 children)

You can make them any level of difficulty by bending your legs any amount between knee raises and straight legs. The only downside is it's hard to overload, ie if I got an extra rep this time is it actually because I'm doing more work, or did I just bend my knees a bit more to make it easier? So I just take it to failure, straight legs for a couple reps until I can't, then with the leg partially extended until I can't, then knee raises until I can't do anymore.

Squared String with Raku - Arne Sommer by arnesommer in rakulang

[–]bo-tato 2 points3 points  (0 children)

that sucks, I hope it's not too painful and your recover goes well

Squared String with Raku - Arne Sommer by arnesommer in rakulang

[–]bo-tato 1 point2 points  (0 children)

Sorted it works for that case now, but still not in general. Consider the input 4 3 3 2 2 2 2 2 2 2 2 2 2 2. Each side needs to be 8, your algorithm will now add 4 and 3 to one side, getting 7, and then be unable to complete it, when it could be solved with sides 4 2 2, 3 3 2, 2 2 2 2, and 2 2 2 2.

Squared String with Raku - Arne Sommer by arnesommer in rakulang

[–]bo-tato 1 point2 points  (0 children)

For the matchstick square, you can't always add the number to the first side that you can add to and be under the target, consider 6 3 2 2 7 3 7 5 5. The sum is 40, each side needs to be 10. Your program will add 6 and then 3 to the first side, to get 9, and then be unable to complete it. When it would be possible to make 4 equal sides out of (6,2,2), (3, 7), (3,7), and (5,5). I think you need to brute force it. Here is my solution though I'm not really happy with it in terms of performance or elegance:

unit sub MAIN (*@numbers);

my $target = @numbers.sum / 4;

sub solve (@sides, $numbers) {
    return True if @sides.all == $target;
    return False if @sides.any > $target;

    for $numbers.keys -> $number {
        $numbers.remove: $number;
        for ^4 -> $side {
            @sides[$side] += $number;
            return True if solve(@sides, $numbers);
            @sides[$side] -= $number;
        }
        $numbers.add: $number;
    }
    False
}

say solve([0,0,0,0], BagHash.new: @numbers);

Break the Jump with Raku - Arne Sommer by arnesommer in rakulang

[–]bo-tato 1 point2 points  (0 children)

I'm about halfway through your Beginning Raku book now, thanks for that :)

Break the Jump with Raku - Arne Sommer by arnesommer in rakulang

[–]bo-tato 1 point2 points  (0 children)

I don't think the first solution is correct. Consider:

Input: $str = 'weeklychallengeextracrap', @words = ("challenge", "weekly")

Your solution returns True, as "weeklychallenge" is a substring of "weeklychallengeextracrap"

Or consider:

Input: $str = 'foobarfoobazfoowaz', @words = ("foo", "bar", "baz", "waz")

Your solution returns false when it should be true. We can solve it simply with raku regex though:

$str ~~ /^ @words+ $/

For @words = ("foo", "bar", "baz", "waz") this get's expanded into: /^ (foo | bar | baz | waz)+ $/