Or it could be like https://pkg.go.dev/modernc.org/sqlite, which took the 
Sqlite C source code and transpiled it into pure Go.

Refs:
https://twitter.com/bradfitz/status/855271867162083329?lang=en
https://groups.google.com/g/golang-nuts/c/QDEczMhlQBU/m/4lCn2kP0AwAJ

On Monday 14 October 2024 at 18:35:49 UTC+1 Nikolay Dubina wrote:

> wow, impressive. but how does this work without C? don't you have to link 
> to some standard OS rendering frameworks which are most likely in C? or do 
> you communicate through syscalls? 
>
> On Wednesday, October 2, 2024 at 9:25:24 PM UTC+8 Mandolyte wrote:
>
>> Worked! Thanks
>>
>> On Wednesday, October 2, 2024 at 9:18:41 AM UTC-4 Jan Mercl wrote:
>>
>>> On Wed, Oct 2, 2024 at 3:07 PM Mandolyte <ceci...@gmail.com> wrote:
>>>
>>> > What did I do wrong?
>>>
>>> Copying the go.mod file effectively declares the code in hello.go to be 
>>> in package modernc.org/tk9.0.
>>> That's the package hello.go imports, hence the import cycle. This works 
>>> here:
>>>
>>> jnml@t3610:~/tmp$ mkdir tk
>>> jnml@t3610:~/tmp$ cd tk
>>> /home/jnml/tmp/tk
>>> jnml@t3610:~/tmp/tk$ ls -la
>>> total 8
>>> drwxr-xr-x  2 jnml jnml 4096 Oct  2 15:15 .
>>> drwxr-xr-x 17 jnml jnml 4096 Oct  2 15:15 ..
>>> jnml@t3610:~/tmp/tk$ cp ~/src/modernc.org/tk9.0/_examples/hello.go .
>>> jnml@t3610:~/tmp/tk$ go mod init example.com/hello
>>> go: creating new go.mod: module example.com/hello
>>> go: to add module requirements and sums:
>>> go mod tidy
>>> jnml@t3610:~/tmp/tk$ go mod tidy
>>> go: finding module for package modernc.org/tk9.0
>>> go: found modernc.org/tk9.0 in modernc.org/tk9.0 v0.29.1
>>> jnml@t3610:~/tmp/tk$ CGO_ENABLED=0 go run hello.go 
>>> jnml@t3610:~/tmp/tk$ 
>>>
>>> Hope this helps.
>>>
>>> -j
>>>
>>>

-- 
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/4e3bcb75-2440-4af8-9374-67148a00de8an%40googlegroups.com.

Reply via email to