1,004 karma · joined Jul 4, 2014 (12y ago) · 544 submissions
comment 1y ago · link · parent
comment 2y ago · link · parent
Anyone who's learned one or two languages should be able to pick up the basics of any of the standard ones pretty much instantaneously.
comment 2y ago · link · parent
At a certain point, the reason we like some particular wacky physical model is always going to be "it has the best combination of explanatory power and simplicity"
comment 3y ago · link · parent
(fn add-1 [x] (+ x 1))
(lambda add-2 [x] (+ x 2))
transpiles to the following lua: local function add_1(x)
return (x + 1)
end
local function add_2(x)
_G.assert((nil ~= x), "Missing argument x on /home/sullyj3/tmp/fn-vs-lambda/fnl/x.fnl:3")
return (x + 2)
end
return add_2comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
For example if you have a shell.nix that you were running with `nix-shell` which defaults to using channels to obtain nixpkgs
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# ...
You can reuse it in your flake.nix devShells.${system}.default = import ./shell.nix { inherit pkgs; };
And it will use the locked nixpkgs input defined in your flake. You can run it with the new `nix develop` command, but `nix-shell` will continue to work, giving you the previous behaviour.comment 3y ago · link · parent
It's conceptually comparably complicated, but the actual practical experience of writing flakes is much more complicated. This is not the fault of flakes specifically, but rather due to the complexity of nixpkgs. Although on second thoughts the fact that there are a bunch of libraries like flake-utils and flake-parts out there does seem to point at a verbosity UX issue.
comment 3y ago · link · parent
It seems plausible to me that even if we are to the AI as cats are to us, we've reached an absolute threshold of generality that allows the AI to be confident in our ability to follow simple (to it) instructions, in a way that cats can't for us.
comment 3y ago · link · parent
comment 4y ago · link · parent
>>> from operator import `add`
>>> list(map(add, range(5), range(10, 15)))
[10, 12, 14, 16, 18]
>>> add3 = lambda x,y,z: x+y+z
>>> list(map(add3, range(5), range(10, 15), range(100, 105)))
[110, 113, 116, 119, 122]