-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #454 from live-codes/develop
release sdk-v0.2.1
- Loading branch information
Showing
89 changed files
with
1,779 additions
and
369 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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# C/C++ (Wasm) | ||
|
||
TODO... |
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,3 +1,60 @@ | ||
# Fennel | ||
|
||
TODO... | ||
[Fennel](https://fennel-lang.org/) is a programming language that brings together the speed, simplicity, and reach of [Lua](https://www.lua.org/) with the flexibility of a [lisp syntax and macro system](<https://en.wikipedia.org/wiki/Lisp_(programming_language)>). | ||
|
||
Fennel code is compiled to Lua, which then runs in the browser using [Fengari](https://fengari.io/). See documentation for Lua language support in LiveCodes [here](./lua.md). | ||
|
||
:::info Note | ||
|
||
Lisp language family supported in LiveCodes includes [Common Lisp](./commonlisp.md), [Scheme](./scheme.md), [ClojureScript](./clojurescript.md) and [Fennel](./fennel.md). | ||
|
||
::: | ||
|
||
## Usage | ||
|
||
JavaScript interoperability and DOM access is achieved using [`"js"` module](https://github.com/fengari-lua/fengari-interop). | ||
|
||
import LiveCodes from '../../src/components/LiveCodes.tsx'; | ||
|
||
This example demonstrates usage, JavaScript interoperability and DOM access: | ||
|
||
<LiveCodes template="fennel" height="80vh"></LiveCodes> | ||
|
||
## Language Info | ||
|
||
### Name | ||
|
||
`fennel` | ||
|
||
### Extension | ||
|
||
`.fnl` | ||
|
||
### Editor | ||
|
||
`script` | ||
|
||
## Compiler | ||
|
||
[Fennel](https://fennel-lang.org/) | ||
|
||
### Version | ||
|
||
Fennel v1.3.0 | ||
|
||
## Code Formatting | ||
|
||
Using [Parinfer](https://shaunlebron.github.io/parinfer/). | ||
|
||
## Starter Template | ||
|
||
https://livecodes.io/?template=fennel | ||
|
||
## Links | ||
|
||
- [Fennel](https://fennel-lang.org/) | ||
- [Fennel tutorial](https://fennel-lang.org/tutorial) | ||
- [Lua](https://www.lua.org/) | ||
- [Fengari](https://fengari.io/) | ||
- [lua](./lua.md) in LiveCodes | ||
- [Common Lisp](./commonlisp.md) in LiveCodes |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Lua (Wasm) | ||
|
||
[Lua](https://www.lua.org/) is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description. | ||
|
||
LiveCodes can run Lua in the browser using [Wasmoon](https://github.com/ceifa/wasmoon). | ||
|
||
> Wasmoon is a real Lua 5.4 VM with JS bindings made with WebAssembly. | ||
> | ||
> [github.com/ceifa/wasmoon](https://github.com/ceifa/wasmoon) | ||
:::info Note | ||
|
||
LiveCodes also supports running Lua using [Fengari](https://fengari.io/) which is the Lua VM written in JavaScript. Read documentation [here](./lua.md) | ||
|
||
::: | ||
|
||
## Usage | ||
|
||
LiveCodes runs Lua in the browser. JavaScript interoperability and DOM access is achieved using the global variable `window` which exposes the page `window` object. | ||
|
||
import LiveCodes from '../../src/components/LiveCodes.tsx'; | ||
|
||
This example demonstrates usage, JavaScript interoperability and DOM access: | ||
|
||
<LiveCodes template="lua-wasm" height="80vh"></LiveCodes> | ||
|
||
## Language Info | ||
|
||
### Name | ||
|
||
`lua-wasm` | ||
|
||
### Alias | ||
|
||
`luawasm` | ||
|
||
### Extension | ||
|
||
`.wasm.lua` | ||
|
||
### Editor | ||
|
||
`script` | ||
|
||
## Compiler | ||
|
||
[Wasmoon](https://github.com/ceifa/wasmoon) | ||
|
||
### Version | ||
|
||
Wasmoon v1.15.0 | ||
|
||
## Code Formatting | ||
|
||
Using [`lua-fmt`](https://github.com/trixnz/lua-fmt). | ||
|
||
## Starter Template | ||
|
||
https://livecodes.io/?template=lua-wasm | ||
|
||
## Links | ||
|
||
- [Lua](https://www.lua.org/) | ||
- [Lua documentation](https://www.lua.org/docs.html) | ||
- [wasmoon](https://github.com/ceifa/wasmoon) | ||
- [Lua (using Fengari)](./lua.md) in LiveCodes |
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,3 +1,62 @@ | ||
# Lua | ||
|
||
TODO... | ||
[Lua](https://www.lua.org/) is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description. | ||
|
||
LiveCodes runs Lua in the browser using [Fengari](https://fengari.io/). | ||
|
||
> Fengari (Moon in greek) is the Lua VM written in JavaScript. It uses JavaScript's garbage collector so that interoperability with the DOM is non-leaky. | ||
> | ||
> [fengari.io](https://fengari.io/) | ||
:::info Note | ||
|
||
LiveCodes also supports running Lua using [Wasmoon](https://github.com/ceifa/wasmoon) which is a real Lua 5.4 VM with JS bindings made with WebAssembly. Read documentation [here](./lua-wasm.md) | ||
|
||
::: | ||
|
||
## Usage | ||
|
||
LiveCodes runs Lua in the browser. JavaScript interoperability and DOM access is achieved using [`"js"` module](https://github.com/fengari-lua/fengari-interop). | ||
|
||
import LiveCodes from '../../src/components/LiveCodes.tsx'; | ||
|
||
This example demonstrates usage, JavaScript interoperability and DOM access: | ||
|
||
<LiveCodes template="lua" height="80vh"></LiveCodes> | ||
|
||
## Language Info | ||
|
||
### Name | ||
|
||
`lua` | ||
|
||
### Extension | ||
|
||
`.lua` | ||
|
||
### Editor | ||
|
||
`script` | ||
|
||
## Compiler | ||
|
||
[Fengari](https://fengari.io/) | ||
|
||
### Version | ||
|
||
Fengari v0.1.4 | ||
|
||
## Code Formatting | ||
|
||
Using [`lua-fmt`](https://github.com/trixnz/lua-fmt). | ||
|
||
## Starter Template | ||
|
||
https://livecodes.io/?template=lua | ||
|
||
## Links | ||
|
||
- [Lua](https://www.lua.org/) | ||
- [Lua documentation](https://www.lua.org/docs.html) | ||
- [Fengari](https://fengari.io/) | ||
- [lua-wasm](./lua-wasm.md) in LiveCodes |
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# PHP (Wasm) | ||
|
||
import LiveCodes from '../../src/components/LiveCodes.tsx'; | ||
|
||
PHP in Browser, powered by WebAssembly (using [php-wasm](https://github.com/seanmorris/php-wasm)). | ||
|
||
`php-wasm` runs PHP in the browser using WebAssembly. This matches the behavior of the official PHP interpreter and allows using PHP's standard library. However, it requires relatively large download and has limited capabilities for client-side DOM manipulation. | ||
|
||
:::info Note | ||
|
||
If you need a lighter-weight interpreter with more capable client-side DOM manipulation in PHP and do not need to use PHP's standard library, you may want to use the [PHP interpreter written in JavaScript](./php.md). | ||
|
||
::: | ||
|
||
## Usage | ||
|
||
### Standard Library | ||
|
||
The PHP standard library is supported. | ||
|
||
```php | ||
<?php | ||
phpinfo(); | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
export const infoConfig = {script: {language: "php-wasm", content: `<?php\n\nphpinfo();`}, activeEditor: "script", mode: "result"}; | ||
|
||
<LiveCodes config={infoConfig} height="80vh"></LiveCodes> | ||
|
||
### JavaScript Interoperability | ||
|
||
[JavaScript Interoperability](https://github.com/seanmorris/php-wasm#accessing-the-dom) is achieved via the [VRZNO](https://github.com/seanmorris/vrzno) php extension. | ||
|
||
Example: | ||
|
||
<!-- prettier-ignore --> | ||
export const jsOpParams = { phpwasm: `<?php\n\n// read from DOM\n$oldTitle = vrzno_eval('document.querySelector("#title").innerText');\necho $oldTitle;\n\n$newTitle = 'Changed@' . date('h:i:s');\n\n// set DOM properties\nvrzno_eval('document.querySelector("#title").innerText = "' . $newTitle . '"' );\n\n// run console.log\nvrzno_eval('console.log("Hello, World!")');\n`, html: `<h1 id="title">Hello, PHP!</h1>\n`, console: 'open' }; | ||
|
||
<LiveCodes params={jsOpParams} height="80vh"></LiveCodes> | ||
|
||
Check the [starter template](#example-usage) for another example. | ||
|
||
## Language Info | ||
|
||
### Name | ||
|
||
`php-wasm` | ||
|
||
### Extension | ||
|
||
`.wasm.php` | ||
|
||
### Alias | ||
|
||
`phpwasm` | ||
|
||
### Editor | ||
|
||
`script` | ||
|
||
## Compiler | ||
|
||
[php-wasm](https://github.com/seanmorris/php-wasm) | ||
|
||
### Version | ||
|
||
`php-wasm` v0.0.7, running PHP v8.2.4 | ||
|
||
## Code Formatting | ||
|
||
Using [prettier](https://prettier.io/) and [Prettier PHP Plugin](https://github.com/prettier/plugin-php). | ||
|
||
## Example Usage | ||
|
||
<LiveCodes template="php-wasm" height="80vh"></LiveCodes> | ||
|
||
## Starter Template | ||
|
||
https://livecodes.io/?template=php-wasm | ||
|
||
## Links | ||
|
||
- [PHP](https://php.net/) | ||
- [PHP documentation](https://www.php.net/manual/en/) | ||
- [php-wasm](https://github.com/seanmorris/php-wasm) | ||
- [PHP using Uniter](./php.md) in LiveCodes |
Oops, something went wrong.