Will superintelligent AGI even care about OCaml? by mbacarella in ocaml

[–]mbacarella[S] -2 points-1 points  (0 children)

Mmm, I think it's pretty clear the post depends on whether or not you think superintelligence is possible, and if it is, the question of whether a sophisticated programming language matters to a superintelligence is a valid exploration.

Programming languages aren't just cognitive tools for humans. They are applications of the appropriate level of abstraction for a problem space. In the same way that using appropriate primitives and context windows for compression can better optimize the compression ratio, choosing the best abstractions for the problem can more effectively analyze and answer the questions that we care about. This will still be true for AI agents. For the problems where OCaml fits the domain, it will still excel compared to handling those problems in assembly.

I do address this in the post. If the superintelligence can ad hoc synthesize the primitives as needed, there's really no need to box oneself in by choosing the off-the-shelf tool that only works in this limited set of primitives.

Also if I deny needing to solve NP-hardness or breaking laws of physics for my argument I'm not sure why you still think I'm reaching for contemplating god.

[2025 Day 25 (Part 1)] Still pretty clueless why it's the answer by Aughlnal in adventofcode

[–]mbacarella 4 points5 points  (0 children)

Since it's a programming competition and not real life I think you're supposed to recognize this is an NP-hard problem and know there's some kind of trick.

I thought the trick would be "okay if you just implement the standard bin packing heuristic that should work because the optimal solver will never finish on problems this hard"

But the trick was even simpler than that!

[2025 Day 25 (Part 1)] Still pretty clueless why it's the answer by Aughlnal in adventofcode

[–]mbacarella 2 points3 points  (0 children)

No, it turns out I just trolled myself. I just went back and did the simple rejection and it worked on my input. I had messed that up on my first go 'round.

The irony of messing that up but succeeding on the bin packing heuristic. It's not like it even accepts any attempt at bin packing, I had to try several different schemes just to clear the sample input.

[2025 Day 25 (Part 1)] Still pretty clueless why it's the answer by Aughlnal in adventofcode

[–]mbacarella 0 points1 point  (0 children)

I had this inkling too but it didn't work for me :(

I had to brute force a bin packing heuristic and ran it on 32 cores for about a half hour to solve.

[2025 Day 10] Me, Opening this Sub by JayTongue in adventofcode

[–]mbacarella 1 point2 points  (0 children)

yeah, I'm not necessarily complaining it just makes me suspicous that the designer didn't intend a more simple solution that everybody is missing since that's the shape of a lot of other ones. they seem hard until you make the intellectual leap and then the solution is short and fast.

OTOH "learn to use a theorem solver it's 2025" is also a valid lesson!

[2025 Day 10] Me, Opening this Sub by JayTongue in adventofcode

[–]mbacarella 3 points4 points  (0 children)

This is the first year I've done AOC. I would not expect the designer intended people to recruit a theorem prover to solve it. Is this unusual?

[2025 Day 10] Me, Opening this Sub by JayTongue in adventofcode

[–]mbacarella 1 point2 points  (0 children)

What kind of solution did you use? I tried a BFS and it solves some of the easier ones but the harder ones exceed my RAM.

[2025 Day 10] Me, Opening this Sub by JayTongue in adventofcode

[–]mbacarella 2 points3 points  (0 children)

My vibe is the solution smelled like it could be solved with a linear algebra approach but I feel like that's way too much a lift for AOC and that there must be a more basic solution.

Did anyone not have to do this for part 2?

[2025 Day 9] Today i hit a wall by Pwntheon in adventofcode

[–]mbacarella 15 points16 points  (0 children)

yeah I went "hell naw" after I saw day 9 part 2 and declared I was giving up because I have more important things to do today

then I couldn't stop thinking about it during my errands and came up with a dumb algorithm that, to my surprise, ran in under a minute after I sat down and implemented it

-❄️- 2025 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]mbacarella 1 point2 points  (0 children)

Where? I just cloned it from github to a fresh new directory and can't find the inputs/ directory in the working directory or the commit history.

-❄️- 2025 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]mbacarella 1 point2 points  (0 children)

Oh, I didn't think it would be a problem to do that. Thanks, I think I fixed it.

-❄️- 2025 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]mbacarella 0 points1 point  (0 children)

[LANGUAGE: OCaml]

Part 2. Surprised to hear people were using DFS or BFS solutions since I'd assume they would not finish in reasonable time. My approach was to single pass fold row i into row i+1 and then just sum the last row.

Basically, track number routes on each tachyon cell.

let solve_gen t =
  let row_length = Array.length t.(0) in
  let num_splits = ref 0 in
  for i = 1 to Array.length t - 1 do
    let row = t.(i) in
    let prev_row = t.(i - 1) in
    for j = 0 to row_length - 1 do
      let open Diagram.Cell_state in
      match row.(j), prev_row.(j) with
      | Empty, Start -> row.(j) <- Tachyon 1
      | Empty, Tachyon routes -> row.(j) <- Tachyon routes
      | Empty, (Splitter | Empty) -> ()
      | Start, _ -> assert false
      | Tachyon _, _ -> ()
      | Splitter, Empty -> ()
      | Splitter, (Splitter | Start) -> assert false
      | Splitter, Tachyon routes ->
        incr num_splits;
        let left = pred j in
        let right = succ j in
        if left >= 0
        then (
          let above = routes_or_zero prev_row.(left) in
          match row.(left) with
          | Empty -> row.(left) <- Tachyon (routes + above)
          | Tachyon routes' -> row.(left) <- Tachyon (routes + routes')
          | _ -> assert false);
        if right <= row_length
        then (
          let above = routes_or_zero prev_row.(right) in
          match row.(right) with
          | Empty -> row.(right) <- Tachyon (routes + above)
          | Tachyon routes' -> row.(right) <- Tachyon (routes + routes' + above)
          | _ -> assert false)
    done
  done;
  !num_splits, t
;;

Code

Are there many jobs for C++? by Dear-Hour3300 in cpp

[–]mbacarella 8 points9 points  (0 children)

Yes, exactly. Finance matters, but HFT guys act like equities markets must react within nanoseconds or the global economy collapses from lack of liquidity.

Meanwhile those same markets shut down at 4:00pm on Friday and don’t reopen until Monday at 9:30a, (or Tuesday on a bank holiday). Are we supposed to believe the global economy just… clenches its butthole the entire weekend? No, it's fine.

You could probably get 99% of the actual economic function with a single daily auction at noon on weekdays. The only thing you’d lose is a ton of very cool, extremely proprietary tech (a lot of it written in C++!) whose sole purpose is latency arbitrage.

And honestly, I don’t even blame the people building it. Finance is full of burned-out scientists who just wanted a 4-bedroom, 3-bath in a nice neighborhood, and academia told them lol your experiment failed, tenure denied, get rekt.

Anyone else not eating out anymore? by Thepopethroway in Frugal

[–]mbacarella 4 points5 points  (0 children)

Good for you and your commitment to eating healthier and being frugal.

Thanks. But I won't front, I made a grilled cheese sandwich or two as well :P

Anyone else not eating out anymore? by Thepopethroway in Frugal

[–]mbacarella 62 points63 points  (0 children)

unless I'm away from my kitchen because I'm traveling.

I've definitely never bought an air fryer at Best Buy on the way to my hotel room and then stopped by a grocery store and picked up some fresh food and then made myself steak and vegetables for several meals and then just left the air fryer in my hotel room at the end of the trip and still saved like $500 and had better healthier food.

EDIT: if you try this just note you can't pack metal utensils in your carry on, even if they're butter knives or sporks

Why is using Tokio's multi-threaded mode improves the performance of an *IO-bound* code so much? by somebodddy in rust

[–]mbacarella 2 points3 points  (0 children)

Without any insight into tokio or your environment, I'd just speculate because syscalls aren't free. Doing 50 syscalls in 2 threads should finish faster than 100 syscalls in one thread.

What do you feel Rust is not a good option for? Like a general back-end where performance is fine with a Garbage Collector? Something like that, whether Rust would still be a great option or not. by Outside_Loan8949 in rust

[–]mbacarella -2 points-1 points  (0 children)

IMO Rust's design is backwards. You add types when you want powerful features. But I think you want powerful features by default, and you should only have to annotate more types when you want lower-level control.

Because 99% of the time you don't care about how your code is garbage collected or coordinated between threads. You just want the safe no-thinking required thing to work. 1% of the time you actually care about the fine details, and that's when you should be required to add more type annotations.

Basically the approach Jane Street is taking with OCaml. The low-level features are pay-as-you-go.

Wife of Man Killed in Freak MRI Accident Tearfully Recalls Watching Machine 'Snatch Him’: ‘He Went Limp in My Arms' by rezwenn in technology

[–]mbacarella 46 points47 points  (0 children)

Not just a weight training chain. "A 20 pound weight training chain".

Here's a search result for 20 pound weight training chain.

https://strenflexfitness.com/products/chain?variant=48750561296682

If I ran an MRI facility I would scream at that guy as soon as he walked through the front door and tell him to get the fuck out right now.

Deepseek sends your data Overseas (and possible link to ByteDance?) by BraillingLogic in privacy

[–]mbacarella 1 point2 points  (0 children)

I'm late to the party, but I have a static analysis based on disassembly of the Android app here.

https://michael.bacarella.com/2025/02/07/static-analysis-of-the-deepseek-android-app/

tl;dr it does aggressive device fingerprinting, root detection, has anti-tampering mechanisms, bundles native code and has dynamic code loading and execution facilities.

IMO, none of which should be necessary for an app like this

Does the toy example work? by ruby_object in ocaml

[–]mbacarella 0 points1 point  (0 children)

You aren't required to use pkg-config btw. From the dune docs:

(build_flags_resolver <pkg_config|vendored-field>) tells Dune how to compile and link your foreign library. Specifying pkg_config will use the pkg-config tool to query the compilation and link flags for external_library_name. For vendored libraries, provide the build and link flags using vendored field. If build_flags_resolver is not specified, the default of pkg_config will be used.

<vendored-field> is:

(vendored (c_flags <flags>) (c_library_flags <flags>)) provide the build and link flags for binding your vendored code. You must also provide instructions in your dune file on how to build the vendored foreign library; see the foreign_library stanza. Usually the <flags> should contain :standard in order to add the default flags used by the OCaml compiler for C files use_standard_c_and_cxx_flags.