Accelatrix - A parallel in-browser functional programming framework
by•
A parallel functional programming framework for in-browser processing of enumerations of business entities.
If you are looking for a low-friction way to tackle multithreading in the browser, this is your ticket in.
Replies
Best
Maker
📌
If you would like to have a typed C#-like runtime in the browser capable of type introspection at runtime instead of just at designtime with TypeScript, you reached the right place.
If you are a fan of LINQ for Objects and enumerations, you definitely reached the right place.
If you are looking for a low-friction way to tackle multithreading in the browser, this is your ticket in.
With this framework all JavaScript objects have :
- GetHashCode()
- GetType()
- Equals()
- ToString()
This enables to do things at runtime like:
var myDog = new Bio.Mammal(8);
var myCat = new Bio.Feline(8, 9);
var timeIsSame = (new Date()).Equals(new Date()); //true
var areEqual = myDog.Equals(myCat); // false
var myCatType = myCat.GetType(); // Bio.Feline
var myCatBaseType = myCat.GetType().BaseType; // Bio.Mammal
var isAnimal = myCat.GetType().IsAssignableFrom(Bio.Animal); // true
var enums = Bio.TypesOfLocomotion.GetType(); // Accelatrix.EnumType
Furthermore, it also comes with a powerful LINQ-like framework that operates on enumerations (beyond simple collections) of business entities, allowing you to elevate your abstractions:
var myEnumeration = Accelatrix.Collections.Enumerable.Range(0, 10000000)
.Select(z => z % 2 == 0
? new Bio.Feline(z % 10, 9)
: new Bio.Mammal(z % 10))
.OfType(Bio.Mammal)
.Where(z => z.NumberOfTits != 1)
.GroupBy(z => z.NumberOfTits)
var myResult = myEnumeration.Skip(2)
.Take(4)
.ToList()
.OrderBy(z => z.NumberOfTits);
Not to mention that it uses Web Workers to parallelise work and provide a Promise while remaining compatible with ES5:
Accelatrix.Collections.Enumerable
.Range(0, 100)
.AsParallel() // sends everything to threads
.Select(z => "Item " + z.toString())
.Skip(2)
.Take(10)
.ToList()
.Catch(ex => console.error(ex))
.Then(z => console.log(z))
or using ES6 syntax:
await [1, 2, 3, 4, 5, .....].AsParallel() // sends everything to threads
.Select(z => z * -1)
.Where(z => z % 2 == 0)
.ToList()
Replies