Kipper-Lang / Kipper

The Kipper programming language for Browsers and Node.js 🦊✨ Made at HTL Leonding & JKU Linz
https://kipper-lang.org
GNU General Public License v3.0
26 stars 4 forks source link

[Feature] Support Kipper `<script type="text/kipper"></script>` tags #11

Open Luna-Klatzer opened 2 years ago

Luna-Klatzer commented 2 years ago

Affected area by change:

Short Introduction and Summary Implement a basic script tag, which allows the usage of <script type="text/kipper"></script> for kipper code, which removes the need to initialise and call the compiler like planned in the release v0.1.0.

Is your request related to a problem? Please describe.

Currently, Kipper is mostly only developer-friendly and not very intuitive for beginners, as you have to understand the background of Kipper and understand how to use JS in a browser, which seems unnecessarily complicated.

Describe the solution you'd like

Implement automatic detection for script tags that have the type text/kipper, which will be automatically converted to TS, compiled down to JS and executed using the browser.

Example:

<script type="text/kipper">
  /* Simple Hello World Program */
  call print("Hello world!");
</script>

Describe alternatives you've considered

Create a new function called Kipper.runAll(), which would compile and run all script tags instead of automatically running all kipper-tags.

Additional context

None.

Luna-Klatzer commented 2 years ago

Once this is added, add a warning in the documentation that it is recommend to use @kipper/cli locally to compile the code down to TS/JS, since it can heavily affect performance unless it's inside a WebWorker.

Luna-Klatzer commented 2 years ago

This should be implemented with #86.

Luna-Klatzer commented 1 year ago

There is still uncertainty if this should be implemented, as even if it'd simplify the compilation process, it'd influence the runtime of the client and may not be as useful.