Comments (5)
Hah, I thought for a moment you were soliciting input on whether user defined operators would be a good idea in rust, which I 100% oppose in every conceivable way.
But if you're into it I guess...
The precedence groups themselves don't seem to have been a problem in swift. One thing that is a problem is that operators can, if you're unlucky about how you do name lookup, participate in global name overload resolution and some expensive global type-constraint-solving problems. Makes for some whole-module search and coupling you might not want (a la multimethods). IOW try to just make operators sugar for a member call or at most an already-defined whole-module dispatch mechanism like a typeclass, don't do anything additional for the operators. That was a design mistake on swift's part we're backing off of.
from pikelet.
One interesting problem is trying to do precedences in an ok/semi-sane sort-of-way. I think Fortress had something where you could define groups of operators with related precedences. Swift has precedence groups - not sure how that turned out for them. Would you happen to know @graydon?
from pikelet.
Thanks for the info! Might try tracking down some code/libraries that use them to see how it looks. I'd just like to avoid the numeric precedences that are kind of hard to use/visualise in Coq, Agda, and Lean.
Unlike Swift, Pikelet won't have overloading apart from instance arguments (#13), so I'm guessing that would dodge the global name lookup issue? It would kind of look like:
Monoid (a : Type) = Record {
empty : a,
append : a -> a -> a,
};
(<>) : {a : Type} {{M : Monoid a}} -> a -> a -> a;
(<>) {{M}} = M.append;
from pikelet.
Shrug it's hard for me to say, I mean, it only really bites us because we have a bad exponential-search problem in expression constraint solving, and any whole-module coupling between files causes whole-module invalidation at the incremental level any time you change a file that uses such a global operator; so both are compile-time costs. Semantically it's no problem.
Whether you can make your implicits system (and compile times) not have those features, well, I hope so!
(ps. I really like the clarity of design docs you're putting out, keep it up! very lucid, makes me feel a bit ashamed at the mess of my note-taking on rust. not to mention total theoretical underpreparedness for what was to come. ah well, hindsight...)
from pikelet.
I really like the clarity of design docs you're putting out, keep it up! very lucid, makes me feel a bit ashamed at the mess of my note-taking on rust.
Thanks for the feedback! Lots of this is based on the stuff I've learned from being around Rust's development process as its grown over the years, and also through some of the mistakes I've made during the development of my own libraries. The stuff we have learned while working on Rust isn't just all the language/type system features, it's also been all the community and process. That takes time, experimentation, and trial and error to figure out - I couldn't have arrived at this on my own!
That said, there are some definite reactions against some of the early design processes. I'm trying hard to keep my eye on the goal of future formalization and core simplicity of design, as I think that's critical to not becoming a culdesac like C++ has become (and what Rust is trying to dodge becoming with RustBelt). Also in communicating intent in preparation for other contributors coming in to help out. But again, I could have only learned that by hindsight via Rust, and by getting excited about language design and theory thanks to your influence! ❤️
from pikelet.
Related Issues (20)
- Turn theory appendix in book into the Pikelet specification HOT 6
- Fix ambiguous dependent function syntax HOT 1
- Pattern match compilation
- Don't panic on mismatched number of record fields
- Get Pikelet to build on wasm HOT 14
- Terminology bikeshed: Universe shifting/lifting/embiggening HOT 5
- Rename signed integer types
- Allow fields to be shifted
- Add a list of keywords to the docs
- Remove `of` keyword from case expressions
- Pikelet driver/loader API HOT 12
- Package manager HOT 4
- Add a top-level integration test suite
- Move away from using Moniker for variable binding HOT 7
- Try using Logos for the lexer HOT 1
- Merge next branch into master
- Fix unfolding avoidance for local variables
- Experiment with Andras Korvacs' version of universe lifting HOT 5
- Workspace doesn't build on a headless linux system HOT 1
- Cannot build with modern versions of Rust
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pikelet.