CodeBlooded

joined 2 years ago
[–] CodeBlooded@programming.dev 9 points 2 weeks ago

I left Reddit after the Apollo app was no longer usable due to the whole API thing. Their app is garbage and until recently their mobile website wouldn’t work (it would force you to visit with the app to view some subreddits).

Now, I use Voyager with Lemmy. I still check in on Reddit from time to time or when searching for info, but I use Lemmy mostly now.

[–] CodeBlooded@programming.dev 1 points 2 weeks ago

When I tell people that I use a GPS app, they almost always insist that it’s easier for me to just head down about a quarter mile south on Aniston Street (if you crossed the train tracks, you’ve gone too far) and make a left on Evansdale, it’s the one with the tree branches covering the stop sign. From there you’re just going to get on the nearest ramp for the express way and get off on 257. Now remember, 257’s exit is actually going to be on your left after about 5 miles, the signs won’t tell you that! Once you take the exit, there’s two burger kings, and you’re gunna wanna turn right after you’ve passed the second one. After that you’ll take your fourth right turn into a large parking lot—you can see the house from there!

[–] CodeBlooded@programming.dev -5 points 3 weeks ago (3 children)

Heads up: once in a blue moon it’s on “sale” for free on Epic Games.

(Ask me how I know.)

[–] CodeBlooded@programming.dev 4 points 3 weeks ago (1 children)

Ah, yes. I keep hearing more and more of people buying merchandise through TikTok among some other seemingly app-only interfaces.

I miss “old internet” :(

[–] CodeBlooded@programming.dev 4 points 3 weeks ago

I bought a VR headset solely to play VTOL VR; worth it!

[–] CodeBlooded@programming.dev 10 points 3 weeks ago (3 children)

I often decide I don’t actually need what I was about to purchase when I run into this, and I close out the browser tab and move on.

…I guess in some weird way, the poor experience benefits me!

[–] CodeBlooded@programming.dev 5 points 3 weeks ago

I was confused when I saw that it was discontinued. I bought several in 2015 and still have them.

[–] CodeBlooded@programming.dev 0 points 3 weeks ago

I’m far more efficient with AI tools as a programmer. I love it! 🤷‍♂️

[–] CodeBlooded@programming.dev 2 points 3 weeks ago

I was looking for this comment. This is it—not AI.

[–] CodeBlooded@programming.dev 5 points 3 weeks ago* (last edited 3 weeks ago)

I time it right so that I can run towards the microwave “in slow motion” and pretend I’m stopping a bomb from going off, 1 second before it blows. My kid loves it. 🤷‍♂️

[–] CodeBlooded@programming.dev 2 points 1 month ago (1 children)

Toyota? Buddy, that’s not a “pickup truck.” That’s a street legal war machine! A technical!!! 😎

 

https://www.beyondallreason.info/

Beyond All Reason is a free and open source RTS that looks exactly how a modern Total Annihilation should.

I grew up playing Total Annihilation as a kid, so it’s great to be able to enjoy it like this as an adult, decades later. Supreme Commander also gave me a lot of fun gameplay, but this feels exactly like classic Total Annihilation. I haven’t been able to put it down.

10/10, I had to spread the word. These developers have created something beautiful (and that’s a compliment to the original developers also!). Enjoy!

 

Voyager, aka ‘wefwef.app’, just hit 1.0

This is a project that makes me really interested in what I can do with a PWA.

(It’s an Apollo-esque (an iOS app for Reddit) progressive web app for Lemmy, and it kicks ass so far.)

 

I’ve been using this to execute Go “scripts” in CI pipelines where Bash just doesn’t cut it. It’s an interpreter for Go. It can be used to treat Go code like a “script,” rather than a compiled application. It is also able to be imported into a Go program and used to load up Go code dynamically at run time (think “loading plugins” with Go!).

From the readme:

release Build Status GoDoc

Yaegi is Another Elegant Go Interpreter. It powers executable Go scripts and plugins, in embedded interpreters or interactive shells, on top of the Go runtime.

Features

  • Complete support of Go specification
  • Written in pure Go, using only the standard library
  • Simple interpreter API: New(), Eval(), Use()
  • Works everywhere Go works
  • All Go & runtime resources accessible from script (with control)
  • Security: unsafe and syscall packages neither used nor exported by default
  • Support the latest 2 major releases of Go (Go 1.19 and Go 1.20)

Install

Go package

import "github.com/traefik/yaegi/interp"

Command-line executable

go install github.com/traefik/yaegi/cmd/yaegi@latest

Note that you can use rlwrap (install with your favorite package manager), and alias the yaegi command in alias yaegi='rlwrap yaegi' in your ~/.bashrc, to have history and command line edition.

CI Integration

curl -sfL https://raw.githubusercontent.com/traefik/yaegi/master/install.sh | bash -s -- -b $GOPATH/bin v0.9.0

Usage

As an embedded interpreter

Create an interpreter with New(), run Go code with Eval():

package main

import (
	"github.com/traefik/yaegi/interp"
	"github.com/traefik/yaegi/stdlib"
)

func main() {
	i := interp.New(interp.Options{})

	i.Use(stdlib.Symbols)

	_, err := i.Eval(`import "fmt"`)
	if err != nil {
		panic(err)
	}

	_, err = i.Eval(`fmt.Println("Hello Yaegi")`)
	if err != nil {
		panic(err)
	}
}

Go Playground

As a dynamic extension framework

The following program is compiled ahead of time, except bar() which is interpreted, with the following steps:

  1. use of i.Eval(src) to evaluate the script in the context of interpreter
  2. use of v, err := i.Eval("foo.Bar") to get the symbol from the interpreter context, as a reflect.Value
  3. application of Interface() method and type assertion to convert v into bar, as if it was compiled
package main

import "github.com/traefik/yaegi/interp"

const src = `package foo
func Bar(s string) string { return s + "-Foo" }`

func main() {
	i := interp.New(interp.Options{})

	_, err := i.Eval(src)
	if err != nil {
		panic(err)
	}

	v, err := i.Eval("foo.Bar")
	if err != nil {
		panic(err)
	}

	bar := v.Interface().(func(string) string)

	r := bar("Kung")
	println(r)
}

Go Playground

As a command-line interpreter

The Yaegi command can run an interactive Read-Eval-Print-Loop:

$ yaegi
> 1 + 2
3
> import "fmt"
> fmt.Println("Hello World")
Hello World
>

Note that in interactive mode, all stdlib package are pre-imported, you can use them directly:

$ yaegi
> reflect.TypeOf(time.Date)
: func(int, time.Month, int, int, int, int, int, *time.Location) time.Time
>

Or interpret Go packages, directories or files, including itself:

$ yaegi -syscall -unsafe -unrestricted github.com/traefik/yaegi/cmd/yaegi
>

Or for Go scripting in the shebang line:

$ cat /tmp/test
#!/usr/bin/env yaegi
package main

import "fmt"

func main() {
	fmt.Println("test")
}
$ ls -la /tmp/test
-rwxr-xr-x 1 dow184 dow184 93 Jan  6 13:38 /tmp/test
$ /tmp/test
test

Documentation

Documentation about Yaegi commands and libraries can be found at usual godoc.org.

Limitations

Beside the known bugs which are supposed to be fixed in the short term, there are some limitations not planned to be addressed soon:

  • Assembly files (.s) are not supported.
  • Calling C code is not supported (no virtual "C" package).
  • Directives about the compiler, the linker, or embedding files are not supported.
  • Interfaces to be used from the pre-compiled code can not be added dynamically, as it is required to pre-compile interface wrappers.
  • Representation of types by reflect and printing values using %T may give different results between compiled mode and interpreted mode.
  • Interpreting computation intensive code is likely to remain significantly slower than in compiled mode.

Go modules are not supported yet. Until that, it is necessary to install the source into $GOPATH/src/github.com/traefik/yaegi to pass all the tests.

Contributing

Contributing guide.

License

Apache 2.0.

 

OrbStack is a fast, light, and simple way to run Docker containers and Linux machines on macOS. You can think of it as a supercharged WSL and Docker Desktop alternative, all in one easy-to-use app.

I just caught wind of this and have yet to try it. Does anyone here have any experience with OrbStack that they can speak to? 👀

view more: next ›