1.  

    I am not pro or contra centralization per session but the author misses the point that economics is largely a function of technology - specially if we view institutions as social technology

    1. 0

      Interesting read. I wonder why people keep making a big deal of multiple return values (or so-called algebraic types) when it’s a kind of trivial programming style issue

      if( !((x = f(y)).error))z(); else return x.error; // even decrepit C can use structures as return values.

      1. 8

        C allows you to have both or neither of them filled in. A Rust Result allows Ok or Err, but both is not allowed and neither is not allowed; it must be one or the other. Multiple return values in Go are also allowed to have both filled in, which is why Go’s error handling pattern is terrible.

        1. 4

          More helpfully: in Rust you can’t use the result without handling any potential error.

          In C or Go you can write code that doesn’t check whether an error occurred and it will seem to work most of the time.

        2. 1

          Do you mean multiple return types?

        1. 1

          Thanks

          1. 1

            Yeah, I was thinking of you there. I decided just to submit the recent finds this week. Keep an eye out on front or in recent for them.

          1. 2

            Working through some PLT texts, looking for a msc theme in lightweight ormal methods

            1. 6

              Working my way through Types and Programming Languages from Benjamin Pierce and watching talks from ICFP. Trying my hands at ocaml to see I like it better than Haskell for that kind of PLT studies.

              1. 2

                Worth noting that ML was designed to write a prover. Most provers also export it. Outside proof, SML has been used for many language experiments like Flow Caml and MultiMLton. CakeML is verified implementation. Many compilers or experimental languages written in it or Ocaml. Ocaml was also used for Esterel’s SCADE code generator for safety-critical. Ocaml is also getting some mainstream backing with Jane St’s help. So, either Standard ML or restricted version of Ocaml are good for this sort of thing with prior tooling to build on… maybe… depends on quality given it was academic projects focused on publishing more than code quality.

                Still experiment to find what you like the most. Whatever you can personally work with the best and has library support for your problems will benefit your productivity the most. That will be important for iterating on ideas in academic setting.

              1. 2

                There are some tricks in Elixir that might qualify. A few DSLs do a lot of optimizations at compile time. One example is Plug.

                1. 3

                  You should look up on memorization: recording previous function calls and reusing the result when calling with the same arguments. You are doing something very similar by working incrementally on the list of results

                  1. 2

                    Typical memoization isn’t something you can do with just pure functions, but it could be done with an Erlang process storing state. I wanted to keep my implementation simple, so I didn’t spawn a process to store state. If you look at Dave’s Gist that I linked to, it contains an exercise where he does use processes to make his implementation faster. Using a list is an easy way of getting the benefits of memoization using pure functions. The downside is once the functions return no state is retained, unlike memoization which persists across calls.

                    1. 2

                      You can’t do the typical memoization by closing over mutable state, but you can memoize a pure function by making the state an explicit parameter and part of the return value, so fib(nth) -> integer becomes fib(nth, { nth: integer}) -> (integer, { nth: integer). Now fib has a dictionary it can check for memoized values from, and add values to by returning the tuple of result + possibly larger dictionary. (Basically, the state monad.) This is a really lovely design in recursive code like the Fibonacci sequence.

                      1. 2

                        That’s true. I was thinking of memoization in the OO sense where the state is implicit and nothing has to be passed around.

                  1. 1

                    Does anybody know if fuzzing compilers is common place?

                    1. 1

                      Since I’m on PC now, here is the link: Csmith.

                      1. 1

                        I’d guess that it isn’t given the results Csmith by John Regehr et al got. Google that. They’d have probably found less bugs if the developers were already fuzzing their compilers. Searching just now did lead to some maybe-submission-worthy stuff I might post later.

                        1. 2

                          Oh that would be great. I tried googling for GHC fuzzing but didn’t found much. But given all the compiler extensions and optimizations available maybe it should be a nice target. Thanks for the csmith link.

                      1. 2

                        Hey, this is a nice view on business. Not everything is unicorns and you can get a pretty decent opportunity aiming at smaller scale businesses. A lot of businesses that go all or nothing could be far more successful by not overstretching. I think a lot of businesses are far beyond their optimal scale - just think whether there is something necessary about Uber valuing at 50b+ and burning so many money.

                        1. 4

                          I am going through some Coq tutorials and getting pretty amazed at how cool it is. But I am also thinking about how does theorem proving and other formal methods apply to web services that are basically composition of calls to other services.

                          1. 3

                            This is very good stuff.

                            This got me thinking that maybe Coq is not harder than Idris. Actually I think it is sometimes easier because Coq neatly separates proof from program when in Idris things get a bit mixed.