Threads for joakin

  1. 8

    I linked to the tweet since there seems to be no blog post at https://tauri.app/ But in the page is where they highlight the new release, and they have v1 guides and documentation up to date.

    Very exciting IMO, looking forward to trying it out

    1. 12

      The tweet does at least give an elevator pitch, unlike the home page which makes the cardinal sin of not telling you WTF the thing is. You can scroll down and read between the lines of the feature pitch, but it took me some navigation to finally find a page that lays it out:

      Tauri is a toolkit that helps developers make applications for the major desktop platforms - using virtually any frontend framework in existence. The core is built with Rust, and the CLI leverages Node.js making Tauri a genuinely polyglot approach to creating and maintaining great apps.

      This looks super cool!

      1. 1

        Thanks for posting this, I’ve been tracking it for awhile to see how it comes along.

      1. 9

        Gren starts as a fork of Elm with the long term objective of adding support for more web APIs and backend support via JS platforms.

        It is an alpha release so it still has ways to go, but I think it has great promise given the creator and contributors to become a very useful language in the future.

        1. 4

          We try to write an assertion type to confirm that the type guard’s internal logic is actually proving something at the type level. Otherwise you can have factually incorrect type guards because Typescript makes no effort to validate them. You’d be surprised at how many type safety regressions this catches during refactors.

          type Assert<Base, T extends Base> = T
          
          class Toad {
            config?: Config
            hasConfig(): this is { config: Config } {
              if (this.config) {
                // check logic actually narrowed our type
                type _assertHasConfig = Assert<{ config: Config }, this>
                return true;
              }
              return false;
            }
          }
          

          (I’m not sure if this exact assertion works here as we don’t use much class at Notion.)

          1. 1

            I’m not sure I understand– can you demonstrate where this is necessary with a counterexample?

            1. 3

              I think he means that the if statement is arbitrary and typescript doesn’t enforce that you are actually narrowing the type to what the return type assertion says.

              See this playground example.

              In the if statement I’m checking the name instead of config, and everything compiles normally, which means that you can have runtime errors because you lied to the type system.

              If you apply jitl’s assertion, then the code doesn’t compile. See this other playground example

              But then if you fix the if statement the code still doesn’t compile: See this last playground example.

              It would be very interesting to see how this would be properly done.

              1. 2

                Yeah, I think the narrowing rules work differently or don’t work for this versus more normal references. I haven’t had time in front of a computer to make a good example — all my lobsters posting is from my phone.

          1. 3

            There are rough edges as it is still in development, but the TypeScript-but-sound goals of the project make it very interesting from my point of view.

            It even supports using the TS type definitions (with some limitations), which could allow leveraging all the work that has gone into typing JS libraries.

            1. 2

              Instead of spectacle I’ve been using https://github.com/ianyh/Amethyst, a tiling window manager. There is no coming back once you get used to it.

              1. 1

                do you use the default config? in the past i think there wasn’t a default config and it did not have time to set it up correctly.

              1. 4

                Interesting technically, but this isn’t good for legitimacy even if the state is supressing it. Your turnout might end up being crypto nerds and secessionists who are hardcore enough to become crypto nerds.

                [edit:] Overall, I put this one in “trying to solve a social problem with a technical solution.”

                1. 9

                  So the better solution for “legitimacy” is to give up and let the censors steamroll you?

                  I’m sure the Catalan government would love to use a fully “legitimate” means of disseminating information to their constituents, but they’re having a bit of a hard time.

                  1. 2

                    If they wanted to (and I bet they will) the Spanish government could just raid polling stations. My guess is Spain won’t tolerate this at all and will continue to put up with the whack-a-mole, to avoid setting a precedent.

                    The only real two options are get Spain to agree to a legitimate referendum, or to secede with actual firepower to back it up. I doubt either is likely.

                    1. 6

                      Spain did not tolerate basques speaking euskera or catalans learning catalan at their schools. Now they have to tolerate it…

                    2. 1

                      What about calling for anticipated elections to get a majority of the Catalan parliament to pass the referendum law instead of doing it with half of the parliament against it? The referendum law was approved with half of the parliament against it, which represents more votes than the other half.

                      Even for other stupid things like electing the executives of the public television they required a quorum of 75%, but of course not for this.

                      This is a dirty play by radical nationalist politicians with an agenda, because they had the chance to make it legitimate but instead chose to sidestep half of the population and elected representatives to push for their agenda.

                    3. 5

                      Your turnout might end up being crypto nerds and secessionists who are hardcore enough to become crypto nerds.

                      It’s not like that at all. The resulting website is usable without any crypto knowledge. See for yourself: https://ipfs.io/ipns/QmZxWEBJBVkGDGaKdYPQUXX4KC5TCWbvuR4iYZrTML8XCR/en/where-to-vote/index.html

                    1. 2

                      So I think I just comprehended something about Redux/Vuex and the like: They are the front-end version of a time series (see below) database, but without persistence, and in JS rather than on server side tech, and they proxy in front of actually persistent stores. That’s why they are singletons in the vast majority of cases (because the last thing a JS frontend needs is to be running a consensus protocol between the different components).

                      Is that a fair basic understanding?

                      1. 2

                        I don’t think so. A TSDB is all about saving the history of changes over time. Systems like Redux or Vuex are about providing a structured way to mutate state in an asynchronous system. So at the end of it all, you will only have one version of the state.

                        1. 2

                          Well, in order to enable time-travel debugging would require something akin to a time-series database (even if it’s just a array of functions that can be moved back/forth). Thanks for pointing that out.

                          The core thing that seemed interesting is that Redux/Vuex are tackling a similar problem to a database server. In a sense, both bits of tech are tackling similar problems: managing state when talking to multiple other pieces of code.

                          The reason that seems interesting to me is that it sheds light on a few things that never quite made sense. If you think of them as something akin to an in-memory SQLite/REDIS, then mutations become your API into said data store, and the state in question has a schema of sorts. And since that API is likely to be smaller than the sum total of code accessing it, that means that you have less code to look over when trying to deal with state change bugs.

                          I apologize if I’m stating the blindly obvious, but the comparisons here seem to be a way that one could relate the terminology in a way this currently server side focused dev groks a bit better.

                          1. 1

                            Redux becomes an Event Log system with time travelling, event filtering and replaying, etc. when you plug the redux devtools to it. It is very useful in development.

                            Otherwise it is (as you said) about providing a structured way to mutate state and keep a consistent view to it.

                        1. 1

                          Am I the only one who thinks this looks like the Comic Sans of monospace fonts?

                          1. 2

                            This one is the Comic Sans of monospace fonts http://www.dafont.com/pointfree.font

                            It’s actually fun to use every once in a while :)