[go-nuts] Re: Go JIT

2024-04-09 Thread 'Mihai' via golang-nuts
Maybe http://golang.org/pkg/types and http://golang.org/pkg/build can help 
you.

On Tuesday, April 9, 2024 at 2:04:03 AM UTC+3 Carl-Philip Hänsch wrote:

> Hi,
>
> I saw in go's source code that all methods and data structures regarding 
> parsers, the IR and so on are private.
>
> Is there a way to import go's parser and compiler as a library and start 
> compiling .go files, building IR code at runtime and finally (with some 
> implementation effort) JITing them?
>
> My goal is to "specialize" go code for certain data. For instance a 
> interpreter loop with a big switch v.(type) {} shall be copied and 
> rewritten as if v is known.
>
> Regards
>

-- 
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/2793dc9c-bf55-4a8a-883c-8c2b17d09924n%40googlegroups.com.


Re: [go-nuts] Convert html text to pdf using go language .

2024-04-09 Thread 'Mihai' via golang-nuts
Use princexml command line using https://pkg.go.dev/os/exec . 
There is no native Go package to render html into pdf. 
The issue is very complicated because both HTML and CSS (and potentially 
JS) are complex markup language and as no browser was ever written in Go 
nobody will write HTML and CSS renderers in Go. 

On Saturday, April 6, 2024 at 12:32:05 PM UTC+3 KRITIKA AWASTHI wrote:

> Thanks for suggestion but i want a package for go language .
> weasyprint is for python.
>
> On Friday, April 5, 2024 at 9:54:32 PM UTC+5:30 Harmen wrote:
>
>> On Fri, Apr 05, 2024 at 06:45:03AM -0700, KRITIKA AWASTHI wrote: 
>> > I want to convert html text to pdf using go language . 
>> > Previously, I used chromedp 
>> >  to create PDFs, but 
>> it 
>> > was consuming too much server capacity. So, currently I am using using 
>> > wkhtmltopdf  package which 
>> is 
>> > deprecated . 
>> > There is one more package, gofpdf 
>> > , which is also 
>> deprecated 
>> > and no longer maintained . 
>> > I would appreciate if you suggest some other alternatives of these 
>> > packages . 
>>
>> We use weasyprint with plain `cmd := exec.Command(Exe, "--stylesheet", 
>> cssfile, "-", "-")` and some Go templating. Nothing fancy, works, looks 
>> nice. 
>>
>

-- 
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/37bf8c29-6393-4767-ad9f-32b30f099b03n%40googlegroups.com.