3 ms·
Mostly an ad for Yao. - Is there really a major use case for function traits? Is more elaboration of the type system actually useful? - The original "Rewritin
by Animats 2y ago
Mostly an ad for Yao.
- Is there really a major use case for function traits? Is more elaboration of the type system actually useful?
- The original "Rewriting Rust" article discussed replacing Rust's macro system. That's not mentioned here. If you had to write your macros in Rust, to be run in compile time, would that be a win? I doubt it. Each macro would start with a call to a parser, and then you generate code as strings. This would pay off only for complex cases such as a regular expression compiler. Rust already has compile-time build programs, where you can run Rust during the build process. (I use that to take in an API definition from another source and generate Rust.)
- "Runtime capabilities" seems to be an attempt to build a container system into the language. It's not clear that helps much. That's really the OS's job. Protecting programs against themselves is nice, but not usually the problem. I'd like to see something in Android that gives an app file access with less access than "all files". Like "Can read what was installed for this app, can write working subdirectory for this app, and nothing else."
- gavinhoward 2y agoFair criticisms, John. I just want to address macros. Yao has something like Rust's macros. They are called "keywords," because even the built-in keywords are implemented that way. (That is why Yao can just not have a `while` keyword.) My Yao-based build system, Rig, uses keywords to implement a build DSL. [1] And keywords are fast to compile. [1]: https://rigbuild.dev/build.rig5/#keywords https://rigbuild.dev/build.rig5/#keywords
- nicoburns 2y ago> Is there really a major use case for function traits? Absolutely. They can be used for function overloading, and for manually creating closures from structs, which can be more ergonomic sometimes. Whether you want those features is another matter. The rust compiler supports them but doesn't expose them to stable rust.
- ruthmarx 2y ago> 'd like to see something in Android that gives an app file access with less access than "all files". SELinux has been able to solve that problem in Android for a long, long time now. Which is more appropriate, as you say it should be the job of the OS. The problem is the age old one where users want convenience at the cost of security.