infinisil changed the topic of #nix-lang to: Channel for discussing Nix as a language - https://nixos.org/nix/manual/#chap-writing-nix-expressions - Logs: https://logs.nix.samueldr.com/nix-lang/
globin has joined #nix-lang
rajivr has joined #nix-lang
infinisil has quit [Ping timeout: 246 seconds]
infinisil has joined #nix-lang
Dotz0cat has quit [Ping timeout: 252 seconds]
evanjs has quit [Ping timeout: 252 seconds]
mpickering has quit [Ping timeout: 250 seconds]
davidtwco has quit [Ping timeout: 246 seconds]
mpickering has joined #nix-lang
davidtwco has joined #nix-lang
evanjs has joined #nix-lang
evanjs has quit [Read error: Connection reset by peer]
evanjs has joined #nix-lang
__monty__ has joined #nix-lang
ris has quit [Ping timeout: 260 seconds]
ris has joined #nix-lang
Dotz0cat has joined #nix-lang
Dotz0cat_ has joined #nix-lang
Dotz0cat has quit [Ping timeout: 240 seconds]
rajivr has quit [Quit: Connection closed for inactivity]
WilliButz has quit [Remote host closed the connection]
<infinisil> (continued from #nixos-chat)
<infinisil> pie_: Nope
<infinisil> Well
<pie_> bonk
<infinisil> You could, nixlisp is nix in the end
WilliButz has joined #nix-lang
<infinisil> So you could do `let myfun = args: builtins.elemAt args 0 + 1; in`
<infinisil> I think
<pie_> thats what i tried and i dont think its workng
<infinisil> Show code?
<pie_> tracer just ends up tracing the ast node
<pie_> like so https://bpa.st/EWWA
<infinisil> pie_: Ah yeah, that's kind of expected, because it's lisp :P
<infinisil> Well, some form of crooked lisp
<infinisil> Since I don't actually know any lisp
<infinisil> But `n` is just that, a symbol
* pie_ squints
<pie_> "yes but"
<infinisil> Functions like `(plus n 1)` actually evaluate the symbol to its value before adding something
<infinisil> Huh
<infinisil> Yeah
<infinisil> Lemme see how this is possible..
<pie_> hm, i cant tracer a higher node
<pie_> or my code is just bad
<pie_> but : error: 'functionArgs' requires a function, at /nix/store/b44y8fqa9523hcs3krlq4qarsw6nqgxy-nixos-21.05pre275822.916ee862e87/nixos/lib/trivial.nix:334:42
<pie_> i guess it makes sense that i cant pull this off if everything is just AST and functions get looked up from a scope by name
<infinisil> Yeah I'm starting to suspect that too
<pie_> oh you know what
<pie_> the funcitonargs problem is probably because i only remove the functor attr at the top
<pie_> im not actually sure why it breaks if i dont do that
<pie_> nevermind
<pie_> <sterni> I reverted this five minutes later though because it doesn't work
<pie_> <pie_> oh
<pie_> <pie_> damnit
<sterni> yeah builtins.tryEval is useless :p
<pie_> yes
<sterni> you can upgrade to nixUnstable it has it fixed
<pie_> and ive been ranting about it for years
<pie_> i was surprised you mentioned it and thought it matched the one use case where it does work
<sterni> idk for what it was introduced initially
<sterni> you can probably evaluate nixpkgs using it if you're careful
<sterni> but it's a pain
<pie_> i wanted it for running tests. of course, it was useless
<infinisil> This allows you to do `(lift builtins.trace n n)`
<sterni> pie_: depends on what your tests do :p
<sterni> this works for certain usecases at least
aaronjanse has joined #nix-lang
<pie_> goodAss
<pie_> infinisil: im making a guess that this should also allow me to defun the lift
<pie_> or, def rather?
<infinisil> This can't be done in nixlisp itself
<infinisil> Well
<infinisil> What do you mean by "defun the lift"?
<infinisil> pie_: ^
<pie_> something like (defun tracer (lift _tracer))
<pie_> idk what the right keyword would be but you get the idea
<infinisil> Ah
<pie_> basically bindings lol
<infinisil> Yeah, with `(defun tracer (n) (lift _tracer n) (...))`
<pie_> yeah explicitly passing the args is ez
<pie_> \o/
<pie_> infinisil: now you can use builtin folds and junk? :P
<pie_> gotta go fast
<infinisil> Hehe yeah
<pie_> you could do what emscripten did for js
<pie_> or asmjs or what
<pie_> (well nix doesnt have a JIT)
<pie_> (though im not actually sure what those did other than pick a fast subset of the language or something)
<pie_> infinisil: this is great even seq works
<pie_> i didnt check the source but it was not evident offhand if you had anything for sequences of stuff
__monty__ has quit [Quit: leaving]
pingiun has quit [Quit: Bye!]
pingiun has joined #nix-lang