joshgoebel / wren-essentials

The good stuff you'll need that you can't find in the CLI
MIT License
5 stars 3 forks source link

Roadmap discussion #7

Open joshgoebel opened 2 years ago

joshgoebel commented 2 years ago

To house discussion for the locked Roadmap #6.

The idea is to include the pieces needed to make wren-console a useful tool for general purpose console scripting out-of-the-box. Wren Essentials can currently be built and linked to Wren CLI also, but right now the primary use case considered is for the default wren-console bundling.

If maintained 3rd party libraries already exist that are critical then we will consider vendoring them. Our goal isn't to replace the great 3rd party community of packages with "one ring to rule them all". We'd love to see a system where it was trivial to bundle packages both separately and in a larger collection, such as essentials.

Pure Wren libraries should strongly be considered for inclusion via packaging though (currently via wren-package, rather than bundling. Though wren-console makes it trivially easy to bundle pure-Wren packages into itself.

clsource commented 2 years ago

Some modules that can be useful.

joshgoebel commented 2 years ago

Just OTTOMH:

And currently everything we do here needs to be fully cross-platform... Linux, Mac, Windows (because wren-console currently is). Also I think it's important that people be building this stuff based on needed real world usage not just "well hey we really should have this cause everyone else does". I don't think that's how you build a cohesive library. Real world need means this stuff is actually getting used, battle tested, bugs fixed, etc... I don't want to build a ghost town library.

Pulling in the JSON lib that's already being used in the real-world from DOME was a great example I think.

clsource commented 2 years ago

Maybe another essential would be reading and writing env files like dotenv

https://github.com/Isty001/dotenv-c

joshgoebel commented 2 years ago

Well, before we can do anything useful with the environment we need ENV capabilities in the CLI, which currently do not exist, we likely need to wrap:

Perhaps:

Process.env.all
Process.env["PATH"] 
Process.env["PATH"] = "/usr/bin/"
Process.env.unset("PATH")

Thats likely first a todo/discussion for Wren CLI and Wren Console, as I think environment should be part of the CLI core library...

clsource commented 2 years ago

Other possible feature is date manipulation using https://github.com/hroptatyr/dateutils

clsource commented 2 years ago

Just to share the idea a wren formatter and linter command with a modified wrenanalizer would be cool too

joshgoebel commented 2 years ago

I've already started playing with that idea but I have no idea if I'll finish it.

clsource commented 2 years ago

A good foundation would be an AST that outputs a map or json. Then the formatter or linter can use that.

wrenc ast code.wren

{
 "ast": {}
}
import "json" for JSON
import "essentials" for AST

var astMap = AST.parse(text)
System.print(JSON.encode(astMap))
joshgoebel commented 2 years ago

Does the existing stuff not have an AST already or is it not general enough? I don't see any reason this wouldn't be a library... I meant an ast tool maybe it fun on it's own, but I wouldn't expect to use it. I'd use an AST library or something to parse the source myself, etc... but if all your saying is a workable AST is the first step, I mostly agree.

I was actually going to try a pass with JUST the lexer, and I'm sure you could get something workable but an AST would be better for sure. :)

clsource commented 2 years ago

The ast command can be used by other programs in the future. Maybe a wren language server? Highlighter? A transpiler maybe? Who knows :)