Replies: 7 comments
-
I didn't notice you posted here too! Copying my answer from the other thread:
|
Beta Was this translation helpful? Give feedback.
-
Sorry for that. I think we can close the other one (and maybe clicking on "archive repo" on GitHub to disallow any further contributions - and of course before doing that write at the top of the README that the development happens here under a different name).
Looks promising. Maybe just removing the colons would suffice to make the lang really slick.
Great!
What inets you mean? I have thought of CPS [1] [2] and e-graphs, but what is inets?
There is one often totally overlooked and underrated "feature" of a compiled language. Namely speed of compilation. And because C compilers are generally slow (still much faster than C++ which are still much faster than Rust), it's worth it to use some speed-oriented C compiler (like TCC) which produces slow binaries. And for production ( In Kind we should think about the speed of compilation now before it goes wrong as in Rust 1, 2, 3, 4, ... (small article series from one of the founders and main contributors to Rust). People love speed of compilation and it's often the underlying (invisible and implicit) reason why a language with faster compilation (don't forget about languages with infinite speed of compilation - namely interpreted ones) is chosen over another generally better language. The pressure during development nowadays is very high so the speed of compilation should be taken rather seriously to even allow the language become practical.
I'm not sure whether we mean the same thing. I meant calling C/C++ functions from and importing C/C++ structures into Kind and using them as native Kind functions/lambdas and native types. Therefore my mention of Does Kind support such FFI? Any plans for that?
I've taken a very brief look at the I'm not used to Haskell's Algebraic effects look more promising - my wish would be to make them as easy to use (i.e. syntactically & visually) as effects in Koka (which is in sharp contrast to e.g. Scala where effects are still annoying syntactically & visually). All this is better to demonstrate on some real piece of SW with networking, user input & output, persistence (not only sending strings with selects to a DB queue, but let's say SQLite API with support for fully concurrent rw access), multithreading, etc. E.g. a web server together with some web application (I dislike web technologies, but it'd be a really good demonstrator here). The game you made looks cool - maybe it could be enhanced by some server-client interaction, SQLite persistence, multithreading, etc. There the need for effects, FFI, etc. might be more prominent and might guide us to better design how to syntactically handle it (i.e. which sugar to introduce and around which abstractions).
I've taken a look at holes and if having holes everywhere will compile and run, then yes, it's what I was asking about. But if it covers only some use cases, but leaves one to specify vast majority of types anyway, then I'd consider "holes" not being enough 😉. E.g. I want to write:
^^^ should compile and run because a Later I realize people mistakenly try to pass
Anything along these lines possible? I.e. postpone the type resolution and backpropagate it? |
Beta Was this translation helpful? Give feedback.
-
What colons exactly? All colons and semicolons are optional already!
It is the optimal runtime for functional programs (and arguably everything). It is basically what you get when you have a graph with arbitrary confluent rewrite rules. I need to write a post someday introducing the subject.
I fully heartedly agree, and I'm glad you asked! Having a fast compiler is one of the largest priorities of Kind, so turns out we have a plan. This is actually what I'm working on right now, since the last few changes in the language caused Kind to need way too much time to type-check itself: about 12 secs currently. Time has come to implement some long promised fast type-checking features, so they're coming soon. First of all, let me remark a few things. Dependent types are naturally slow because you can have arbitrary computations on the type level. So the question is, how do we do it as fast as possible? First of all, we must make sure that, if we're type-checking simple/polymorphic terms, that we do it without extra costs. That is, checking a Haskell-like program shouldn't take more time than in Haskell, just because Kind has dependent types. This is something we explicitly optimize in procedures like Second, we must make sure that, when type-level computations are unavoidable, that at least they're performed as fast as possible. This is a huge low-hanging fruit that we can take advantage of. Most (all?) other proof languages use explicit substitutions on type-checking. Agda, Idris, Coq, Lean do that. This is slow. As in, 100-1000x slower than it should be. Our type-checker is 100% HOAS, which means we delegate substitution to native lambdas and, thus, reduce the problem of having a fast type-checker to the problem of having a fast runtime. Right now, though, we compile to JavaScript, which means type-level lambdas use JavaScript lambdas. That's great, but could be better. We'll very soon (like, in 2 weeks or so) migrate to using ChezScheme on the back-end, which means type-level computations will use native ChezScheme closures. This will make type-level substitutions fast. As fast as I think it is practically possible today, since ChezScheme is the fastest strict functional runtime available in the world. Compared to other proof languages, which do a ridiculously heavy "search/replace" of variables every time you apply a function, the difference is just ridiculous. Of course, computation isn't only about substitutions. Sometimes you want to do things like multiplying numbers, sorting lists, manipulating data structures, doing loops. Right now, if you, for example, type-check Third, and, of course, there isn't much point in doing all of these optimizations, if we end up doing more work than needed anyway. Right now, every time you type-check a Kind term, it fully type checks its dependencies, all the way up to their very primitives. So, for example, when you type-check The way it'll work is by storing type-checked, hole-filled top-level definitions in a So, for a roadmap: Kind's type-checker will use ChezScheme native lambdas and incremental compilation in 2 weeks or so. And, a little bit later, it may have JIT compile procedures for fast type-checking of numeric computations and things like that. To be very clear: my goal os to make Kind the fastest type-checker for a dependently typed functional language and I believe I'll accomplish that goal. I'll answer the rest later, a lot to say too but you're covering lengthly subjects like monads, syntax, hole-filling/inference/unification, error messages etc. So I'll need some time to address these |
Beta Was this translation helpful? Give feedback.
-
Again, thanks for the detailed write up! It sheds light on some things I was afraid of.
Oh, didn't know that! So I assume the following is valid:
and means the same as:
Very much looking forward to that! I skimmed your repository with inets, but I'm still missing some broader train of thought to realize their potential (and weaknesses/upper_and_lower_bound 😉).
Clever!
It might be rather less related to Kind's backend, but let me point out that ChezScheme still seems several times slower than non-functional languages (let's not discuss the benchmark itself and its accuracy - it's merely to demonstrate the trend and there I think it's representative enough). But let's see how it goes in practice (I can easily imagine Kind will use mostly "highly optimizable" constructs of ChezScheme shifting the gaus curve closer to leading non-functional languages in the benchmark). My goal would be sub-second non-production-build (i.e. build without deep optimizations) compilation of non-cached project of the size of "full" Kind (i.e. several hundreds of thousands of lines of Kind source code).
Yes! Yes! Yes! Caching! That'll help a lot in large projects!
Take your time and thanks! |
Beta Was this translation helpful? Give feedback.
-
Oh I meant Incremental compilation was added on |
Beta Was this translation helpful? Give feedback.
-
Fwiw, I'd also like to know what the situation and roadmap is with Kind's language interoperability and FFI. |
Beta Was this translation helpful? Give feedback.
-
This is a copy of Soonad/FormalityFM#6 as I'm not sure where the development happens mostly.
Newbie here. I'm impressed by the goals (and their actual current state of implementation). Well done!
I'd like to ask some questions (some more dumb, some hopefully less). I might be adding more over time in comments below 😉.
-prod
build?claim
similar to what I envisioned in Concatenative languages - Quark zesterer/tao#8 (comment) (as a substitute for C libs being incapable to deliver the proof terms Formality requires) along witheffect
from Koka to cleanly handle the "errors" and all other impure stuff.goto
, I dislike pure functions (because the number of arguments becomes tremendously verbose), but I think theeffect
as in Koka (or the same but slightly disguised in Dylan as outlined in The future of Quark henrystanley/Quark#2 (comment) ) might have some potential (compared to rewriting the whole lib in Formality).sassert
assert
andclaim
from Concatenative languages - Quark zesterer/tao#8 (comment) which can be added any time later to make the code type check without rewriting & refactoring huge portions of the code).Beta Was this translation helpful? Give feedback.
All reactions