Newest at the top
2025-05-05 00:00:19 +0200 | <hellwolf> | that becomes the essence of the if-then-else control structure, the codegen will translate that to the target language code, which is rather short. |
2025-05-04 23:58:34 +0200 | <hellwolf> | my old ITE didn't use cartesian closed, created duplicated coded. |
2025-05-04 23:58:30 +0200 | notdabs | (~Owner@2600:1700:69cf:9000:953a:ffda:3cd1:4a35) () |
2025-05-04 23:58:16 +0200 | <hellwolf> | ^-- that constructor reads: give me two morphisms from a ~> b, representing two branches of the if-then-else, I will you give back a new morphism also from a (must be, otherwise doesn't compose) to another morphism (hence closed cartesian) that is BOOL ~> b |
2025-05-04 23:58:10 +0200 | notdabs | (~Owner@2600:1700:69cf:9000:953a:ffda:3cd1:4a35) |
2025-05-04 23:55:53 +0200 | <hellwolf> | to be continued. |
2025-05-04 23:55:49 +0200 | <hellwolf> | I don't need the INT after all, if I can make this type-check |
2025-05-04 23:55:40 +0200 | <hellwolf> | thanks for the help |
2025-05-04 23:55:38 +0200 | <hellwolf> | that'd be my new constructor to replace old inefficient ITE. |
2025-05-04 23:55:20 +0200 | <hellwolf> | YulITE :: YulCat eff a b -> YulCat eff a b -> YulCat eff a (YulCat eff BOOL b) |
2025-05-04 23:54:08 +0200 | <hellwolf> | no, that's good. I have different approach here. But I can do a similar thing. |
2025-05-04 23:54:03 +0200 | <tomsmeding> | anyway bedtime for me o/ |
2025-05-04 23:53:50 +0200 | <tomsmeding> | though usually I do have more types in the language to interpret so that there's actually something to preserve :p |
2025-05-04 23:53:27 +0200 | <tomsmeding> | I've written this kind of code too often |
2025-05-04 23:53:19 +0200 | <tomsmeding> | apologies for being impatient for a bit there by the way, it's late here |
2025-05-04 23:52:22 +0200 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2025-05-04 23:48:33 +0200 | <tomsmeding> | :') |
2025-05-04 23:48:31 +0200 | <tomsmeding> | if you want practice with this particular trick, do assignment 0.3 here https://utrechtuniversity.github.io/infomcpd/assignments/asg0.pdf |
2025-05-04 23:47:13 +0200 | <hellwolf> | I am digesting |
2025-05-04 23:46:45 +0200 | <EvanR> | see what tomsmeding just did |
2025-05-04 23:46:29 +0200 | <EvanR> | doesn't matter what source language |
2025-05-04 23:46:11 +0200 | <EvanR> | functions are expressed as functions |
2025-05-04 23:45:58 +0200 | <EvanR> | yes this is what higher order abstract syntax does |
2025-05-04 23:45:30 +0200 | <hellwolf> | what code? This code snippets is not even Haskell... |
2025-05-04 23:45:30 +0200 | <hellwolf> | | there's always a way to convert code into a haskell function |
2025-05-04 23:45:29 +0200 | <tomsmeding> | and create that `->` function by partially-applying `go` to the term you wish to store in the Value |
2025-05-04 23:45:14 +0200 | <tomsmeding> | alternatively: `data Value = VWord WORD | VFun (Value -> State EvalData Value)` |
2025-05-04 23:45:09 +0200 | <hellwolf> | I can't do that in Eval. But let it be, I think I find away. |
2025-05-04 23:45:07 +0200 | <EvanR> | there's always a way to convert code into a haskell function |
2025-05-04 23:44:59 +0200 | <hellwolf> | I store the snippets and it becomes a function object |
2025-05-04 23:44:45 +0200 | <hellwolf> | code snippets is basically what's generated by https://github.com/yolc-dev/yul-dsl-monorepo/blob/master/hs-pkgs/yul-dsl/src/YulDSL/CodeGens/Yul/I… |
2025-05-04 23:44:33 +0200 | <tomsmeding> | perhaps `data SomeTerm = forall a b. YulO2 a b => SOmeTerm (YulCat eff a b)` |
2025-05-04 23:44:22 +0200 | <EvanR> | if not an AST |
2025-05-04 23:44:09 +0200 | <EvanR> | at least your codesnippets are in a more convenient form than blob of Text? At least it's a string of tokens? xD |
2025-05-04 23:44:05 +0200 | <hellwolf> | which is not very useful because I can't even run the code snippets until the external compile compiles it |
2025-05-04 23:43:51 +0200 | <tomsmeding> | `data SomeTerm = forall a b. SomeTerm (YulCat eff a b)` ; `data Value eff = VWord WORD | VFun (SomeTerm eff)` |
2025-05-04 23:43:41 +0200 | <hellwolf> | reality |
2025-05-04 23:43:39 +0200 | <hellwolf> | in really |
2025-05-04 23:43:38 +0200 | <hellwolf> | it will be represented in code snippets :D |
2025-05-04 23:43:21 +0200 | <tomsmeding> | `data Value = VWord WORD | VFun (WhateverYourFunctionRepresentationWillBe)` |
2025-05-04 23:43:15 +0200 | <hellwolf> | haha |
2025-05-04 23:43:11 +0200 | <tomsmeding> | I don't fucking care lol |
2025-05-04 23:43:05 +0200 | <hellwolf> | the only way to playback in Hask is through Eval. |
2025-05-04 23:42:59 +0200 | <hellwolf> | I can't, the function is created in DSL itself, I have no way to recreate that function in Hask |
2025-05-04 23:42:38 +0200 | <tomsmeding> | and then you'll have to branch on what Value you get to see if it's what you expect |
2025-05-04 23:42:27 +0200 | <tomsmeding> | I suspect you'll have no choice but to do `data Value = VWord WORD | VFun (Value -> Value)`; `newtype EvalData = MkEvalData (M.Map B32 Value)` |
2025-05-04 23:42:10 +0200 | <hellwolf> | For Eval, I need to find a different strategy. |
2025-05-04 23:41:58 +0200 | <hellwolf> | yea, deadend, I won't do that for Eval. The codegen is easy though, because codegen can use Map Int T.Text to store code snippets |
2025-05-04 23:41:46 +0200 | tromp | (~textual@2001:1c00:3487:1b00:25b8:e34c:8097:c1c7) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2025-05-04 23:41:39 +0200 | Typedfern | (~Typedfern@213.red-83-37-26.dynamicip.rima-tde.net) typedfern |