95 points · by YorickPeterse · 8y ago · 45 comments
The example I would like to see is the one that shows the language's object-orientedness and message-passing. Something like "public_send" or "define_method". And maybe show runtime reflection capabilities, if Inko has them.
Also, some questions you might want to answer on the main page/in examples:
* What platforms are supported?
* How big is the standard library?
* How do I encode/decode JSON/XML?
* What's the C FFI story?
* Are there benchmarks?
> Looks pretty good. I see someone has been reading "The Error Model" by Joe
> Duffy, eh?
Yes! It was a _huge_ inspiration. In fact, I wasn't sure what error handling
mechanism to use until I read the article. > Something like "public_send" or "define_method". And maybe show runtime
> reflection capabilities, if Inko has them.
Good call, I'll note this down. Technically this is possible at the moment, but
it's not exactly user friendly.Regarding your list of suggestions, I agree that having those would be nice, and I'll see how I can best add those.
The state of the standard library can best be described as "very young". For example, only recently did I manage to add enough building blocks to build a testing standard library, and one of the next goals is to make sure everything is tested before adding more.
Benchmarks aren't available yet because I think it's too early. FFI is planned, but not yet supported.
Are you sure? Using message passing doesn't magically make stuff immune to races. You Still have to think about atomicity.
Here is an excerpt from the documentation on my multiprocessing library, zproc.
> Are you sure? Using message passing doesn't magically make stuff immune to races.
> You Still have to think about atomicity
Sure, _just_ using message passing doesn't do much. But Inko doesn't have shared memory (well apart from a permanent heap, but that's a different story and it has a very specific purpose). Perhaps I phrased things the wrong way, but the idea is that because there's no shared memory, you can't have data races due to concurrent modifications.Anyway, is there any reason as to why one would not use more mature languages like erlang and recently, dart? They also have the concept of isolates, that can't share memory.
Apart from the written in rust part which is really cool.
- What is your plan on package management? - With concurrent languages I always see a great potential of building something that is better than Go lang and not backed by Google. For that to happen you need native Async IO support. Do you plan to make it part of core? - Do you plan to support something like green-threads, coroutines, or go routines?
Take my opinion as a biased web developer who is looking for a better performing compiled language than Node.js or Go lang.
> What is your plan on package management?
There is no fixed plan yet. My idea is to take an approach similar to CPAN: the registry (where you manage your account, packages, etc) and mirror (where you download the packages from) are two separate systems. This makes it easier to set up your own mirror. The mirror would just be a static file server of some kind (e.g. an S3 bucket). Security wise I was thinking of using TUF (https://theupdateframework.github.io/), though I have yet to actually sit down and read through it. > For that to happen you need native Async IO support. Do you plan to make it part of core?
In Inko, similar to Erlang and Elixir, you don't really need async IO. This is because IO operations are offloaded to a separate thread pool. Inko may one day use async IO operations for this under the hood, though it certainly wouldn't be exposed directly to the language. In practise this means that instead of this: file.open('foo/bar.txt', function(handle) {
handle.read(function(data) {
...
}
}
You just do this: import std::fs::file
let handle = try! file.read_only('foo/bar.txt')
let data = try! handle.read
"try!" here just means "try this operation, panic (= terminate) if it fails". In the above example, `read_only` opens a file in read-only mode, and `read` reads from it. Both are blocking operations, but both run on a separate thread pool. > Do you plan to support something like green-threads, coroutines, or go routines?
This is built-in using the `std::process` module, one of the core foundations of Inko. If you're interested, you can read more about this here: https://inko-lang.org/manual/getting-started/concurrent-prog...I wonder how avoid to build one, and just reuse a good one. How feasible is it?
There's a lot of interesting work going on in this field so to save you some research I suggest looking through at least the related works section of my thesis (see profile).
When you see code such as `process.send`, that means we're sending the "send" message to the "process" module, which ends up calling a corresponding method. This method then sends the actual message to a process.
Channels are a great idea! What capabilities (send on channel/receive on channel) can you forward to other processes? As Cloud Haskell explain, in distributed systems we must not allow send on channel to be forwarded.
Regarding channels, both linear channels and mailbox types for unordered interactions are interesting ideas worth looking into.
Great project!
The summary is: it protects the project better than the MIT license does. As far as I know the only difference with Apache 2 is that MPL 2.0 requires that modifications are licensed under the same license.
Note I could not find any docs.
> Note I could not find any docs.
Maybe I should rephrase the Documentation page (https://inko-lang.org/documentation/) a bit to make the link to the manual stand out more. The manual can be found here: https://inko-lang.org/manual/, all the chapters can be found in the sidebar.Note that if you are on a mobile device, you need to tap the "Toggle sidebar" link at the top to display it.
I don't really see Inko as a direct competitor to Go, as Go's compiled nature makes it quite different in use cases. Maybe when we have a JIT and an easy way of distributing the VM + code, Inko could be a competitor to Go.
> Do you have a problem that your laguage can solve really better than others.
> Or are you still figuring out?
Ignoring that Inko is still a very new language, there are already a couple of benefits compared to Ruby such as: no need to pause everything during garbage collection, easier to write concurrent programs, preemptive multitasking (using more than one OS thread under the hoods, unlike both Ruby and Node), more straightforward syntax (at least I think so), etc.And along those lines, how would you envision handling processes that panic, I presume they don't send out Hail Mary messages to sibling processes? Does one process take down them all with the intent of restarting the lot (with an external watchdog?)
Runtime exceptions can't bubble up implicitly, and they can't be thrown at the top-level. This prevents an exception 15 call stacks deep taking down the entire system unexpectedly.
I do agree that zero division errors are a bit of an odd case to deal with, as it's not unlikely for them to happen during runtime. Having said that, in the past 10 years of coding I have never seen code that handled zero division exceptions and didn't just straight up ignore them (something I don't want to promote).
I believe Pony returns 0 for zero division errors. As crazy as this may be, I do somewhat understand their choice. I think integer divisions would be easier if there was something like NaN but for integers.
> And along those lines, how would you envision handling processes that panic
Several years into the future, I envision there is a way to somehow act upon them (e.g. logging them in Sentry or a similar service), but the system would still shut down after this has been completed. I however will not add a mechanism that allows you to just swallow a panic.Expected errors such as network timeouts will use exceptions, and these have to be explicitly handled. For example, if you try to open a file that you don't have access to, an exception is raised.