[go-nuts] Re: rsc.io/script: How to contribute?

2024-03-06 Thread Ajay Kidave
I have had a good experience 
using https://github.com/commander-cli/commander for testing CLI commands. 
It uses a yaml file for test config. I generally avoid yaml but the 
commander config format is easy to work with. Never used script, the state 
saving between commands feature might be missing in commander-cli.

On Wednesday, March 6, 2024 at 1:52:57 PM UTC-8 twp...@gmail.com wrote:

> *rsc.io/script
>
> On Wednesday, March 6, 2024 at 10:46:23 PM UTC+1 twp...@gmail.com wrote:
>
>> Internally, Go has a very nice package for integration testing 
>> .
>>
>> Roger Peppe  has been doing a fantastic 
>> service by making it public and maintaining it as a community project at 
>> github.com/rogpeppe/go-internal/testscript 
>> , and 
>> Roger's package has been extremely valuable for my project 
>>  and many others.
>>
>> Over a quarter of a year ago, Russ Cox  
>> made a semi-official release of the code 
>>  which includes several improvements 
>> (e.g. better modularity), but also removing critical functionality 
>>  required to make rsc.io/script 
>> usable by other projects.
>>
>> Appeals to the author about how to contribute 
>>  have been met with silence. 
>> Fundamental issues like installation failures 
>>  have had no response.
>>
>> Does rsc.io/switch have a future? If so, how can we contribute? This is 
>> a fantastically useful piece of software for the Go community and we will 
>> all be better off if it succeeds.
>>
>> Regards,
>> Tom
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7c9f87e4-1665-4bd5-abdf-1db10215e774n%40googlegroups.com.


Re: [go-nuts] text template range over Rangefunc

2024-03-04 Thread Ajay Kidave
Sure, created a proposal at https://github.com/golang/go/issues/66107

Ajay
On Monday, March 4, 2024 at 2:11:59 PM UTC-8 Ian Lance Taylor wrote:

> On Mon, Mar 4, 2024 at 11:47 AM Ajay Kidave  wrote:
> >
> > The https://go.dev/wiki/RangefuncExperiment change will be a great 
> addition to the language. I wanted to know whether the text/html template 
> std libraries will allow range over rangefunc. Currently, the doc for 
> text/template says
> >
> > {{range pipeline}} T1 {{end}}
> > The value of the pipeline must be an array, slice, map, or channel
> >
> > It would be great if rangefunc is supported in templates. The specific 
> use case for me is passing a rangefunc created on a sql row iterator to a 
> template.
>
> Makes sense to me. Do you want to open a proposal at
> https://go.dev/issue to add this to the template package? Thanks.
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a02d1b91-d5e0-4577-946c-d1c413ce54adn%40googlegroups.com.


[go-nuts] text template range over Rangefunc

2024-03-04 Thread Ajay Kidave
The https://go.dev/wiki/RangefuncExperiment change will be a great addition 
to the language. I wanted to know whether the text/html template std 
libraries will allow range over rangefunc. Currently, the doc for 
text/template 

 
says

{{range pipeline}} T1 {{end}}
The value of the pipeline must be an array, slice, map, or channel

It would be great if rangefunc is supported in templates. The specific use 
case for me is passing a rangefunc created on a sql row iterator to a 
template.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7b920383-306e-4a73-b7be-c994470fc04bn%40googlegroups.com.


Re: [go-nuts] Re: Clace: Secure web application development platform using Starlark

2023-10-30 Thread Ajay Kidave
Clace itself is Apache-2 licensed, using a MPL licensed library in an
Apache-2 licensed project is fine from what I understand. I do not plan to
make any code changes to the go-plugin code. The go-plugin library is
specifically allowed by CNCF projects if that matters
https://github.com/cncf/foundation/blob/main/license-exceptions/cncf-exceptions-2023-06-27.json#L3
.

The intent in Clace is to allow multiple versions of a plugin to be usable
for backward compatibility. That, plus the security and stability benefits
of the out of process model make the go-plugin approach work better than
the .so/.dll approach.

Ajay

On Mon, Oct 30, 2023 at 11:55 AM Jason E. Aten  wrote:

> I would just be aware that using software that is MPL licensed,
>
> https://github.com/hashicorp/go-plugin/blob/main/LICENSE
>
> means that nobody with commercial aspirations will touch your stuff. In
> practice, that means relatively little adoption.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/FyaMylLPGEw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/d56f9aab-19f8-40d4-87a5-59d05e1adb9fn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAFHo40kZpkuAw%2B5r-UV-VjRoJBvg3OAZSZxS3gwq11%3DKxKdeOA%40mail.gmail.com.


[go-nuts] Clace: Secure web application development platform using Starlark

2023-10-18 Thread Ajay Kidave
Hey,

I have been working on a new open source project 
https://github.com/claceio/clace for the past few months. Clace is an 
Apache-2 licensed platform for building secure internal web applications. 
The end goal is to allow fully custom applications as well as workflow type 
applications. Custom apps are supported currently, workflows will come 
later. Clace allows you to build Hypermedia first web applications, where 
the server API returns HTML instead of JSON. With the HTMX[1] library on 
the client side, it makes developing and maintaining interactive websites 
much easier as compared to the regular Javascript SPA model.

Clace is a single binary go application, using sqlite for app metadata. 
Clace apps are written in Starlark [2], which gives a python based syntax. 
The API routes are defined to be Hypermedia first, using the Chi 
library[7]. Each API specifies what HTML to return for a full page reload 
and what to return for a partial request from HTMX. Go HTML templates are 
used for the response. The starlark code runs in a sandbox, it can make 
external calls through plugins. The plugin boundary is used to enforce 
security policies[3]. This allows for policies like permit GET requests but 
not POST/DELETE, which are difficult to do with a container or jail based 
approach.

Clace bundles esbuild to allow importing javascript libraries as ESModules. 
TailwindCSS/DaisyUI watcher integration is supported, although many simple 
apps can use classless CSS libraries. The goal is to have a no build 
approach, the dev artifacts are checked into git and directly used for 
serving prod. Importing new ESM libraries or new TailwindCSS classes 
requires a one time setup operation, which runs automatically in dev mode. 
Other than that, most code changes do not need a build step. Content hash 
based file names with a virtual file system is used, similar to hashfs[4]. 
This allow for aggressive static content caching, even without a build step 
doing file renames. For deployment, certmagic[5] is used for automatic TLS 
certs. App routing is supported based on path and/or domain, allowing for 
deployment flexibility. The plan is to allow plugins to be loaded 
dynamically using go-plugin[6], currently two plugins are built into the 
server, exec for running CLI command and http for REST API calls. Building 
UI for CLI tools and backend for frontend type use-cases are supported 
currently.

https://github.com/claceio/clace/tree/main/examples/ has some simple sample 
apps (the *_gen* files are auto generated), the sample apps are running 
online at https://demo.clace.io/

If you are building Web interfaces with Go HTML templates, I believe Clace 
will make the development process much easier. Do try it out and let me 
know any feedback.

Regards
Ajay

[1]: https://htmx.org/
[2]: https://github.com/google/starlark-go
[3]: https://clace.io/docs/applications/appsecurity/#security-model
[4]: https://github.com/benbjohnson/hashfs
[5]: https://github.com/caddyserver/certmagic
[6]: https://github.com/hashicorp/go-plugin
[7]: https://github.com/go-chi/chi

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/87dbe1af-32e1-4517-8681-80642789f8dcn%40googlegroups.com.