kmruiz / sonata Goto Github PK
View Code? Open in Web Editor NEWActor-based DDD-first programming language
License: MIT License
Actor-based DDD-first programming language
License: MIT License
Sonata does not implement, yet, any modularization system that allows hiding internal state to a module. Right now the compiler will let you use any defined class, and this class will be stored in the top-level scope.
Sonata, however, does implement a way to import files with source code based on a include path.
Any modern language should contain a painless module system that allows developers to reuse code enforcing their best practices:
Sonata is meant to be a simple language, so the module system should be also as simple as possible and opinionated on best practices. There is a minimum set of requirements:
A suggested approach would be:
std.lib
std
is parent of std.lib
std.lob
is sibling of std.lib
std.lib.streams
is child of std.lib
internal
can only be seen by the same module, siblings and children.; src/my/module/foo.sn :: module: my.module.foo
internal let foo() = 1
; src/my/module/bar.sn :: module: my.module.bar
requires my.module.foo
let bar() = foo() + 1 ; visible because my.module.bar is sibling of my.module.foo
; src/my/module/foo/fooer.sn :: module: my.module.foo.fooer
requires my.module.foo
let fooer() = foo() ; visible because my.module.foo.fooer is child of my.module.foo
; src/main.sn :: module: main
requires my.module.foo
foo() ; does not compile, foo() is internal to module my.module.foo
Now actors are reentrant because we are not ensuring the order of consumption. We need to make sure that actors do process messages one by one, and that actors are reentrant.
Right now, NodeDockerTest
do not run in Github Actions and fail with a timeout. Find a way so those tests can be run in CI.
Sonata does not implement, yet, generics.
We need to support generics to ensure type safety in the communication between entities.
Sonata is meant to be a simple language, so generics should be as easy as possible. We want to make sure the following constraints are considered:
A suggested approach would be:
So we have the following cases:
; let's assume a new Bag class:
entity class Bag<T> {
let put(a: T) = {}
}
; If we use the Bag to store a contract, it will be covariant:
contract Toy {}
entity class Football implements Toy {}
entity class Basketball implements Toy {}
let toys = Bag<Toy>()
; If we use the Bag to store a football, it should work
toys.put(Football())
; If we have a bag to store footballs, only footballs are allowed
Bag<Football>().put(Basketball()) ; fails
Right now we are not able to compose a function with a method, or two methods together.
Sample code with the issue:
value class Price(amount: number) {
let format() = '$' + amount
}
let printPrice: (Price) -> any = ?.format() -> println
Compiler output:
[ERROR] [samples\playground.sn:27:34] near 'a.format() -> println': Only functions can be composed.
Enterprise applications require a mature and opinionated observability platform, so they can easily monitor their running applications.
There are some situations where stopping actors block the runtime. It may be a race condition where an actor can not be stopped because it still has pending messages. However, we couldn't reliably reproduce the issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.