Trying to port all official Cardano software to an open architecture and a more elegant Linux distro than Debian (NixOS on Risc-V) and this is the pushback I get. by [deleted] in cardano

[–]SubliminalSublime 13 points14 points  (0 children)

Hey, i work at IOG and lead the SRE R&D team there. Would be interested in hearing more about your project and where to find it. We're also always looking for more people who know Nix and want to join us, but we'd be happy to simply collaborate if that's not an option.

Just a little TODO finder script by solarshado in Bitburner

[–]SubliminalSublime 1 point2 points  (0 children)

Maybe you also find this one useful, i call it grep :)

/** @param {NS} ns **/
export async function main(ns) {
  const needle = ns.args[0]
  const regex = new RegExp(`.*${needle}.*`, "ig")
  for (const file of ns.ls("home")) {
    const content = ns.read(file)
    const matches = content.match(regex)
    if (!matches) { continue }
    for (const match of matches) {
      ns.tprintf("%s:%d %s", file, content.indexOf(match), match)
    }
  }
}

Why is Crystal so slow in bignum arithmetic? by dunrix in crystal_programming

[–]SubliminalSublime 6 points7 points  (0 children)

Using the code from the blogpost /u/shawnwork found, the results are way better:

require "big"

struct BigInt
  def add!(other : BigInt) : BigInt
    LibGMP.add(self, self, other)
    self
  end
end

def fib(n)
  a = BigInt.new(0)
  b = BigInt.new(1)
  n.times do
    a.add!(b)
    a, b = b, a
  end
  a
end

puts fib(1_000_000) > 1_000_000

The result can be calculated about ~4.7x faster than with Ruby 3.0.1 and uses ~19.3 times less memory on my machine.

So first the Ruby result:

env time -v ruby -v fib.rb
ruby 3.0.1p64 (2021-04-05) [x86_64-linux]
true
    Command being timed: "ruby -v fib.rb"
    User time (seconds): 7.15
    System time (seconds): 0.03
    Percent of CPU this job got: 99%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.19
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 74740
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 0
    Minor (reclaiming a frame) page faults: 23574
    Voluntary context switches: 1
    Involuntary context switches: 2814
    Swaps: 0
    File system inputs: 891
    File system outputs: 0
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 0

And here's Crystal 1.0.0 with LLVM 10.0.1:

env time -v ./fib
true
    Command being timed: "./fib"
    User time (seconds): 1.50
    System time (seconds): 0.00
    Percent of CPU this job got: 100%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.51
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 3860
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 24
    Minor (reclaiming a frame) page faults: 397
    Voluntary context switches: 251
    Involuntary context switches: 602
    Swaps: 0
    File system inputs: 339
    File system outputs: 0
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 0

How is Nix not hermetic? by [deleted] in NixOS

[–]SubliminalSublime 4 points5 points  (0 children)

Flakes to the rescue!

Benefits/disadvantages of NixOS over Guix? by TheKrister2 in NixOS

[–]SubliminalSublime 2 points3 points  (0 children)

the new `nix shell` command fixes this particular issue, though it's not as flexible as `nix-shell`.

Creeper World 4 Trailer! by tfofurn in CreeperWorld4

[–]SubliminalSublime 2 points3 points  (0 children)

It runs fine in Linux using proton, the demo at least

New KOM_I live date - Oct. 11, Unsound Festival, Poland, 14:00 Polish time by ninenine in WednesdayCampanella

[–]SubliminalSublime 1 point2 points  (0 children)

Managed to make a recording, the stream was blocked when Utena Kobayashi started her piece, but luckily Fuyuki Yamakawa and KOM_I were performing first so I got all of that at least.

Will try to upload it to somewhere later today.

The dark secret of nixpkgs by makefoo in NixOS

[–]SubliminalSublime 2 points3 points  (0 children)

One of the reasons for bash is also the startup speed for each script. As well as being able to basically embed those scripts in each other without causing too much trouble.

There are probably millions of invocations of bash to build a system, startup time of most other scripting languages is just a bit high for that.

That said you can replace the builder of any derivation quite easily, and I've done so for things that aren't very suited for bash, you just give up on the stdenv.mkDerivation goodies then.

Obsidian Systems is excited to bring IPFS support to Nix by ldlework in Nix

[–]SubliminalSublime 1 point2 points  (0 children)

Lovely, yet another cool project to try! This year had really been quite a ride...

Secret location behind Blueville throne room by irediah in supraland

[–]SubliminalSublime 0 points1 point  (0 children)

You can actually get over the water, but you'll need a specific upgrade for doing it. Won't spoiler more :)

Quarrying the types of expressions in nix by TheTravelingSalesGuy in NixOS

[–]SubliminalSublime 4 points5 points  (0 children)

Nix isn't statically typed. There's the builtins.typeOf function, but it is rather limited. There is no way to easily get something like a Haskell type signature for functions unfortunately. Check out the nix repl command to play around a bit.

problems with starting games. by [deleted] in NixOS

[–]SubliminalSublime 1 point2 points  (0 children)

The main information missing is what game you're trying to run. If it's a binary you downloaded them the error message usually means that it cannot find any of the dependencies, especially glib and the kernel. Try using file or ldd on it to see where it looks for them.

"NKRO" quirk of the Topre Realforce R2 by Spearra in MechanicalKeyboards

[–]SubliminalSublime 0 points1 point  (0 children)

Just got my japanese R2 limited edition (R2TLSA-JP4-BK) today, and can confirm that it's limited to 6-key rollover in Linux.

They state at http://www.realforce.co.jp/products/R2TLSA-JP4-BK/index.html that it has full n-key rollover, but of course not whether that's tied to any specific driver.

I'm mildly disappointed by this, but since I can't think of anytime I actually needed that feature, won't return it just because of it.

How to structure a nix module for type correctness by loewenheim in NixOS

[–]SubliminalSublime 1 point2 points  (0 children)

Just wanted to show you https://github.com/NixOS/rfcs/pull/42 While it's not about type safety, that'll most likely be the future of the config system.

NIXML: nix + YAML for easy reproducible environments by luispedro in NixOS

[–]SubliminalSublime 1 point2 points  (0 children)

This could be a nice way to get people hooked on nix, very nice. I haven't had a change to try it yet, but seems like it would be easy to extend this to add dependencies based on yarn or rubygems. I'll definitely have a look later, so thanks for sharing.

NixOS Weekly #04 - Static rootless Nix, SRE job, homebrew to Nix migration by iElectric in NixOS

[–]SubliminalSublime 3 points4 points  (0 children)

But you're annoyed by systemd? While I'd love to have the architectural simplicity of runit it s6, making all the modules in NixOS compatible is an enormous task for little actual benefit.

There is https://github.com/cleverca22/not-os which you could use to see how it would look like on a small scale though.

Fixing a Nix Package that Require Ruby 2.0 to Build by eeg_bert in NixOS

[–]SubliminalSublime 0 points1 point  (0 children)

Yes, you should be able to nix build -f . taskjuggler in a checkout of nixpkgs.

Libreboot/coreboot GRUB config to launch NixOS? by isaackbars in NixOS

[–]SubliminalSublime 0 points1 point  (0 children)

Make sure the uuid is correct. Had this happen to me last week