Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce //USE notion #1709

Open
maxandersen opened this issue Dec 3, 2023 · 0 comments
Open

introduce //USE notion #1709

maxandersen opened this issue Dec 3, 2023 · 0 comments
Labels
ideas Some idea/suggestion around jbang behavior/feature set

Comments

@maxandersen
Copy link
Collaborator

originally for jbang I was thinking we should allow //DEPS log4j,xchart as a shorthand for adding the "sensible default set " of dependencies for a java app.

I never did it as it felt somewhat "wrong" to mix this into the raw dependency feature.

Recently I played around with juypter kernels and noticed the kotlin kernel has a %use syntax https://github.com/Kotlin/kotlin-jupyter#supported-libraries.

They have something akin to jbang-catalog and our --source notion which in context of jshell lets you set things up.

Noteworthy is that they have separation of imports and code - but I would say we could handle that by just stripping out ^import .* lines from our sources and use it.

Idea is that you would be able to do //USE faker@jbangdev and we probably should ensure it should be possible to just use //USE faker.

They do also allow %use faker(5.5) where the parameter is used as explicit value for $v in the include. Used to handle custom versions.

Similar they have %useLatestDescriptors which afaics defaults $v to be LATEST.

The usecase for all this is simply to make it super easy to get started with scripting and not having to think/remember much.

With tooling it would "just work" as the sideffect would just be //DEPS in the background for .java and for .jsh we would add imports and default init code.

@maxandersen maxandersen added the ideas Some idea/suggestion around jbang behavior/feature set label Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ideas Some idea/suggestion around jbang behavior/feature set
Projects
None yet
Development

No branches or pull requests

1 participant