This repository has been archived by the owner on Jun 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32a0e59
commit 580eb3d
Showing
1 changed file
with
5 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,11 @@ | ||
<div align="center"> | ||
<img align="center" src="https://i.imgur.com/w2aYNRW.png" width="150"> | ||
<h1>The Melon Runtime Project</h1> | ||
</div> | ||
<img align="left" src="https://i.imgur.com/w2aYNRW.png" width="150"> | ||
<h1>The Melon Runtime Project</h1> | ||
|
||
> *“The computing scientist’s main challenge is not to get confused by the complexities of his own making.” - Edsger Dijkstra* | ||
|
||
> **Warning** | ||
> | ||
> Melon is **NOT** production-ready yet, the project is currently being developed and being battle-tested in different environments. Most of the required features, fixes and optimizations are not ready yet. Use in real-world projects at your own risk. | ||
> Even this README may not reflect the current published Melon situation yet. | ||
Melon is a JavaScript runtime based on the .NET environment with multi-threading capabilities. The project is focused on offering a platform that eases project prototyping, having a clean control of asynchronous environments and parallel events and providing fully compatible interoperability with the .NET features and ecosystem. | ||
|
||
<!-- - **[Documentation (alpha)](https://melon-docs.vercel.app/docs/intro)** | ||
- **[Discord server](https://discord.gg/wDJDT9Yq7C)** --> | ||
|
||
- **[CityJS conference presentation](https://youtu.be/lD39kjrXRvo?t=18715)** | ||
|
||
# Features spotlight | ||
|
||
> Below, are listed **some** features that **already are** in the project or that **are in construction** | ||
## Multi-threaded Promises | ||
|
||
Melon's internal library is focused in providing a multi-threaded workflow with the efficiency of using Promises. To achieve it, dotnet Task and Thread objects are binded to it allowing the final developer to use multi-threaded capabilities without having to do extra work, use libraries or appeal to archaic features like event-based worker threads. | ||
|
||
## Clear API with no mistery | ||
|
||
Melon is *strictly* designed to offer the best and easier **prototyping reliability**, so it contains a lot of features that enables the final developer to create entire applications with minimal (or zero) dependencies and also rewrite parts (or the entire) code easily without having coupled architectures and patterns. | ||
|
||
```typescript | ||
const { server } = Melon; | ||
const host = server.createHost(); | ||
|
||
host.get("/", () => "Hello world"); | ||
host.run(); | ||
``` | ||
|
||
## Easy interop with .NET | ||
|
||
`Realm()` is a feature designed to create and manipulate objects inside the .NET runtime instead of dealing with it inside the JavaScript engine, it allows the developer to create anything in CLR and recover it in the script without losing features or behaviors. Below, there is a quick example on how to create and use the capabilities of a Realm object: | ||
|
||
```typescript | ||
const { Bridge } = Melon.interop; | ||
const API_URL = "https://jsonplaceholder.typicode.com/todos/1"; | ||
|
||
async function httpGetFromCLR() { | ||
let bridge = new Bridge(); | ||
realm.setInstance("httpClient", "System.Net.Http:HttpClient"); | ||
|
||
let client = bridge.get("httpClient"); | ||
let task = client.getAsync(API_URL); | ||
let promise = new Promise((resolve) => resolve(task.result)); | ||
|
||
let result = await promise; | ||
console.log(result); | ||
} | ||
``` | ||
Melon is a JavaScript runtime focused in keeping **clear**, **uniform** and **simple** internal functionalities. Differently from the average options, | ||
Melon was designed to profit from *real parallelism* and *railway-oriented, functional programming*, with capabilities to manage threads in real-time, | ||
create allocations and work efficiently to execute the algorithms properly. |