[use case] Yuescript as a Single Page Application embeddable language?

Offen
#180 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
20/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
lua
Bereich
compilers, web-dev

Rechercherichtung

Beginne mit der Durchsicht der im Issue genannten Referenzen zum Pipe-Operator von Yuescript, Fengari und Pluto. Ermittle, ob die vorgeschlagene Einbettung im Browser, die Lua-Interoperabilität, die einzeilige Pipeline-Syntax und die Verwendung als Neovim-Erweiterung umsetzbar sind. Als abgeschlossen gilt die Aufgabe, wenn der Umfang festgelegt und durch dokumentierte Beispiele oder einen konkreten Implementierungsplan belegt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Hi and thanks for this language! I just discover it yesterday and it's pretty much the response to something I was looking for. I will explain myself in detail here and given that discussions are not yet enabled in this repository, I'll make my comment in the "issues" part, but this is more a conversation on speculative design and the role that Yuescript can play there, to see if can be implemented in practice. If discussions are enabled, I will continue this talk over there (in the "questions" or "ideas" tabs, that are usually available then).

I'm a user of TiddlyWiki, an extensible wiki engine self contained in a single HTML file and I use it for my personal bliki (blog + wiki), my TTRPG group games or research project like one related with the linguistic revitalizing in 4 indigenous communities in the Colombian Amazonas.

And while TiddlyWiki (TW) is a pretty extensible and versatile tool for projects like this, when you start to stretch its usage, you find its limits. To deal with them, we have created TiddlyWikiPharo, a tool that allow us to replicate and import the data model from TiddlyWiki inside the Pharo/GToolkit computing environment, to create interactive documents about how to migrate from Hugo to TiddlyWiki or from WordPress to TiddlyWiki or how to store and visualize the evolution of a wiki (in Spanish). All those use case are possible because we are extending and manipulating TW externally from Pharo/GToolkit, that is where I do almost all of my coding, without dealing too much with the idiosyncrasies of JavaScript and using TW's custom filters and operators language just in the "right amount".

But I would like to extend TiddlyWiki also from inside, without failing into the JS insanity and while keeping the TW's advantages that put it apart from other wiki engines, regarding high malleability, small footprint, the possibility to work offline and a gentle learning curve between being a wiki creator content wiki of creator and functionality.

And given Lua's high embeddability, including the existence of the Fengari JS port of Lua, I made a proposal of a speculative piped Lua variant that would extend TiddlyWiki, with a syntax like the following one (tiddler is TW's name for the unit of content, functionality and/or interface):

tiddlers()
  |> tagged("member")
  |> ramdomized()
  |> template("MemberTemplate")

This is where I imagine that Yuescript could play a role, as already has the proposed syntax and now I wonder:

  1. Could I use Fengari instead of WASM to embed Yuescript in a web page?
  2. Can I call Lua functionality inside Yuescript (and vice-versa), similarly to what is possible with Fennel?
  3. Out of curiosity:
    • Can the example given above be written as a one liner in Yuescript?
    • Have you thought in using Yuescript as a language to program Neovim extensions, again in a similar way to how Fennel is being used?

In this lazy early-year holidays I will slowly familiarize myself with Fengari and Yuescript, and I would like to start implementing something similar to the pipe operator example in Pluto language:

local { http, json } = require "pluto:*"
http.request("https://httpbin.org/get")
|> json.decode
|> dumpvar
|> print
--> {
-->     ["args"] = {},
-->     ["headers"] = {
-->         ["Host"] = string(11) "httpbin.org",
-->         ["User-Agent"] = string(56) "Mozilla/5.0 (compatible; Soup Library; +https://soup.do)",
-->         ["X-Amzn-Trace-Id"] = string(40) "Root=1-65e05b66-6aa8b7c94e7580774a804c24",
-->         ["Accept-Encoding"] = string(13) "deflate, gzip",
-->     },
-->     ["origin"] = string(13) "1.2.3.4",
-->     ["url"] = string(23) "https://httpbin.org/get",
--> }

How can I make something similar using Yuescript?

Thanks in advance any constructive talk and ideas to come,

Vorherrschende Sprache
Lua
Sterne
620
Forks
45
Ø Merge
9 Std. 5 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus IppClub/YueScript

Alle Issues in IppClub/YueScript

Ähnliche Issues

Weitere Issues zu Lua

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.