https://github.com/vurv78/expressive
Expression, but it's Typescript (with extras). Replacement for Expression2, ExpAdv, Starfall
https://github.com/vurv78/expressive
compiler e2 expression2 garrysmod glua gmod programming-language transpiler typescript wiremod
Last synced: 9 months ago
JSON representation
Expression, but it's Typescript (with extras). Replacement for Expression2, ExpAdv, Starfall
- Host: GitHub
- URL: https://github.com/vurv78/expressive
- Owner: Vurv78
- License: gpl-3.0
- Archived: true
- Created: 2022-01-08T21:03:37.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-24T16:38:52.000Z (11 months ago)
- Last Synced: 2025-02-24T17:43:57.276Z (11 months ago)
- Topics: compiler, e2, expression2, garrysmod, glua, gmod, programming-language, transpiler, typescript, wiremod
- Language: Lua
- Homepage: https://vurv78.github.io/Expressive/web/index.html
- Size: 511 KB
- Stars: 13
- Watchers: 1
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> [!NOTE]
> This project never came to fruition, but it'll return for TASBox in my wiremod replacement.
> It's already much further along than Expressive was.
> Keep an eye on https://github.com/mekkanics :)
# Expressive [](https://github.com/Vurv78/Expressive/actions) [](https://github.com/Vurv78/Expressive/blob/master/LICENSE) [](https://discord.gg/u6eQPcZv4y) [](https://vurv78.github.io/Expressive/web/index.html)
> Expression, but it's Typescript with extras
Expressive is the hopeful final solution to the Expression programming languages. It was originally a fork of Expression3, but has become a full rewrite. It is modeled after [Typescript](https://www.typescriptlang.org).
## Note
This is a work in progress. Adding this to the server may be dangerous.
And yes this is codenamed Expression4.
*This could potentially give players access to serverside lua. Yes. It's that bad.*
## Differences from E2
Practically everything.
There are classes, you can finally make lowercase variables, lambdas, and whatnot.
Everything is neatly in libraries, like ``holograms.create``
This also leverages the powerful [Syper](https://github.com/Sevii77/syper) editor instead of the wire editor, which comes with autocomplete, "intellisense", code folding, custom themes and more.
## Example Code
```ts
// You can create lowercased variables now.
// 'var' creates a global variable. It does not follow javascript/ts convention as function scoping is really horrible anyway.
var ops = 55;
ops++;
ops--;
// New function definitions typescript style.
// Note that despite this example having a lack of explicit type annotations, this is a *strictly* typed language.
// The types are inferred by the compiler.
function bar(foo: int, bar: int) {
return foo + bar;
};
// This is not a part of typescript, and custom to Expressive.
// These are expression blocks, which allow you to block your code into scopes for organization.
// You can get the return value out of the last expression in the scope through implicit returns.
{
var global = 55;
let str = "🤖";
{
// Boolean values!
let anotherone = true;
{
// Typed builtin array types. No more array()[1, number]
// Every value inside of it must be the same type.
let an_array = ["Hi"];
}
// 'str' also exists in here
// 'anotherone' is dropped.
}
// 'global' exists in here
print(global)
}
// 'global' exists cause it uses 'var', which defines a global variable
print(global);
// print(str); -- Errors, 'str' is only defined inside of the above scope.
```