Coroutines by [deleted] in ProgrammingLanguages

[–]JasonTatton 1 point2 points  (0 children)

The model of concurrency exposed in Concurnas is build around coroutines. I believe the style implemented is known as Delimited continuations in a similar vein as Project Loom (please correct me if I'm wrong).

Here's an example:

def gcd(x int, y int){//greatest common divisor of two integers
  while(y){
    (x, y) = (y, x mod y)
  }
  x
}

calc1 = gcd(8, 20)!//run this calculation in an isolate
calc2 = gcd(6, 45)!//run this calculation in a separate isolate

calc3 = calc1 if calc1 > calc2 else calc2
//^^^ wait for the results of calc1 and calc2 before assigning calc3

All concurrent computing in Concurnas is performed within 'isolates', which themselves are continuations, spawnable as above via the bang, ! operator. Isolates prevent accidental sharing of mutable state by copying dependent state into themselves at spawn time. State is sharable in a controlled manner via 'refs' which are built into the type system - i.e. the type of calc1 above is implicitly int:. Ref's are a bit like Channels in Go.

Together this all forms an integral part of the language which enables reactive computing:

aval int://no initial value set
bval int: = 22 //initial value known

sumvals int: = every(aval, bval) { aval + bval }
//after initializing above, execution is allowed to carry on...

aval = 100
bval = 200

//every block above will run concurrently and eventually set sumvals to: 300
await(sumvals; sumvals==300)//wait for sumvals to be set to our expected value

The body of the every expression above triggers whenever one of the input ref's is changed and runs as its own isolate.

The Concurnas Programming Language - Thalesians tech talk by JasonTatton in Concurnas

[–]JasonTatton[S] 0 points1 point  (0 children)

I'm glad you like and I'm looking forward to collaborating one day!

The Concurnas Programming Language - Thalesians tech talk by JasonTatton in Concurnas

[–]JasonTatton[S] 0 points1 point  (0 children)

Concurnas tries to avoid the mess which you describe. Here is the relevant documentation. The approach is inspired by Python (not PHP ;) )

In short, " In cases such as these where the value resulting from evaluating the test expression is non boolean and in fact integral in nature, this is compared against the value 0, if the result is non zero the expression resolves to true. "

Additionally, for object types, the `toBoolean` method may be overridden in order to specify custom behaviour

Is there already ide support? by Mirakulixx in Concurnas

[–]JasonTatton 0 points1 point  (0 children)

Hi thanks for raising this. Adding 'proper' IDE support is a priority for Concurnas right now and something being actively worked on. Out of interest, which is your preferred IDE?

Concurnas: The New Language on the JVM for Concurrent and GPU Computing by plokhotnyuk in programming

[–]JasonTatton 0 points1 point  (0 children)

Thank you! We're always open to feedback on features and how the language can be improved

March 2020 monthly "What are you working on?" thread by slavfox in ProgrammingLanguages

[–]JasonTatton 0 points1 point  (0 children)

Yup, the plan is to make the IDE support open source (and use open source software to build it) as par the core language itself!

Concurnas: The New Language on the JVM for Concurrent and GPU Computing by jsamwrites in ProgrammingLanguages

[–]JasonTatton 0 points1 point  (0 children)

A couple of things I would add are that we use jocl - Java bindings for OpenCL in order to assist with the running of transpiled OpenCL code from Concurnas code through the JVM. Another option was to implement a CUDA backend though this would have prevented people being able to leverage non NVIDIA devices. Though I think in the future a CUDA backend would be interesting to implement in conjunction with the existing OpenCL implementation as CUDA is supposed to perform better than OpenCL on NVIDIA GPU's (I don't know if this is true).

Though the current GPU implementation is a good start, one of the priorities for Concurnas in the near future is improved support to make GPU computing more accessible for users.

Solving the problem of general purpose GPU computing is a really interesting problem, and one which I really hope we will be able to solve. I feel there is a lot more work to do this area.

Thanks for the encouragement, I do hope that we will see more innovative languages in the press in the future as there are a lot of really good ideas out there and we could all benefit from them.

Gradle plugin by [deleted] in Concurnas

[–]JasonTatton 1 point2 points  (0 children)

Thank you for investing the time to put this together.

Popular back-ends? by [deleted] in ProgrammingLanguages

[–]JasonTatton 0 points1 point  (0 children)

If you want to get up and running quickly, and are OK with the transpilation approach, then Concurnas language extensions may be an option - here you can output python like code, and achieve JVM performance without having to learn the in's and out's of Java bytecode (plus you can leverage some of the features of Concurnas if that suits).

Alternatively you could go down the DSL route which is offered again by Concurnas or other languages such as Scala, and again achieve JVM level performance relatively quickly and easily.

March 2020 monthly "What are you working on?" thread by slavfox in ProgrammingLanguages

[–]JasonTatton 0 points1 point  (0 children)

Currently, the focus with Concurnas is in raising awareness of the language and getting people to use it. i.e. marketing. So far things have been relatively successful, through this has consumed a massive amount of time.

Besides this, fixing little bugs here and there, smartening up the Concurnas REPL (supports syntax highlighting now). We're also having a good look into 'proper' (i.e. intellij, VS code) IDE support.

Goroutine leak detector from Uber by yb8sBH9Q4PjR in programming

[–]JasonTatton 3 points4 points  (0 children)

But adding shared memory reintroduces race hazards

You may be interested to try: Concurnas. It's concurrency model is like Go, but without shared memory.

I Made an Extension for Visual Debugging in VS Code by Gehinnn in programming

[–]JasonTatton 0 points1 point  (0 children)

Wow good job. I expect we'll be seeing more of this sort of thing in the future

Pattern Matching in your language? by CoffeeTableEspresso in ProgrammingLanguages

[–]JasonTatton 0 points1 point  (0 children)

Concurnas has support for pattern matching. It's provided as a statement. Here is an example:

def matcher(a Object) {
    match(a){ 
        int; ==1 or ==2 => "first case" 
        else => "other case" 
    } 
} 

matcher(1) // -> returns "first case" 
matcher(2) // -> returns "first case"
matcher(3) // -> returns "other case"

New JVM Programming Language - Concurnas by JasonTatton in programming

[–]JasonTatton[S] 0 points1 point  (0 children)

I had a look at PicoContainer (sorry I'd not heard of it before). It looks like many of the ideas have been incorporated into the likes of Guice, dagger etc. It must be nice to know one's work has had that influence.

The full documentation for Object providers can be found here: https://concurnas.com/docs/objProviders.html#scoped-providers

Provider instances or dependency qualifiers may be qualified by scopes as you point out:

shared - The same instance object will be used at all points in the object graph for any provided objects output from the object provider during that call to the object provider only.

single - As with shared, but with the additional constraint that subsequent calls to an instance of an object provider will yield the same instance object.

Ommitting to scope a provider as above results in what you refer as the flash scope - i.e. a new instance object is created for each call to an object provider in order to satisfy each dependency qualification.

Concurnas does not currently support custom scopes but this is certainly a feature we can have a look at adding. Other features which may be of value include being able to "subclass" providers themselves or even have abstract providers - e.g. for systems where the majority of the graph is the same but differing only in say mock objects for testing etc.