@orsinium@fosstodon.org
@orsinium@fosstodon.org avatar

orsinium

@orsinium@fosstodon.org

:python: #python :golang: #golang :elixir: #elixir :rust: #rust #security #foss

No politics.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

JoeRess, to random
@JoeRess@fosstodon.org avatar

Idea for a sport:

Instead of moving really quickly, kicking or hitting or throwing a ball or something really accurately, or outwitting people, how about this?

You have to inflict enough brain trauma on your opponent to render them unable to stay on their feet.

orsinium,
@orsinium@fosstodon.org avatar

@JoeRess

I never quite understood competitive sport. I like climbing because my only opponent there is the physical puzzle that I have to solve.

btp, to random
@btp@fosstodon.org avatar

Are complex environments that require very specific patching and reboot processes the result of poor design? Or are they inevitable at scale?

orsinium,
@orsinium@fosstodon.org avatar

@btp

There are Linux servers and Erlang services with uptime of decades. It's hard to design such a reliable system but possible.

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

I created a little demo showing how you can compile code to and also consume the same Wasm plugin from

Give it a try.

https://github.com/khalidabuhakmeh/ExtismPlayground

orsinium,
@orsinium@fosstodon.org avatar

@khalidabuhakmeh

How heavy is the guest code? I mean the optimized code size and RAM consumption. I'm making @fireflyzero, a game console that runs wasm, and I wonder how much resources a C# game would need.

orsinium,
@orsinium@fosstodon.org avatar

@khalidabuhakmeh

I know! I'm trying to understand how much more. We already have SDKs for Go and Rust but, similar to Exitism, we plan to provide SDKs for other languages as well. If it's feasible to run a C# guest with just a couple of megabytes RAM, we can invest time into adding the language into the officially supported ones.

orsinium,
@orsinium@fosstodon.org avatar

@khalidabuhakmeh

Do you know at least the wasm binary size?

orsinium, to security
@orsinium@fosstodon.org avatar

Which one would you choose?

  1. Make sure you correctly handle user input in SQL queries to prevent SQL injection, or

  2. Make a standard banning any punctuation in geographical places and force local authorities to rename streets and reissue all street signs.

https://www.bbc.com/news/uk-england-york-north-yorkshire-68942321

#security

18+ preslavrachev, (edited ) to golang
@preslavrachev@mastodon.social avatar

Which one is your least favorite?


orsinium,
@orsinium@fosstodon.org avatar

@preslavrachev

Enums I have fixed:
https://github.com/orsinium-labs/enum

Time formatting is bad bud luckily most of the time you'll use one of the predefined constants. And when you really need to work with it a lot, there are third-party alternatives:
https://blog.orsinium.dev/posts/go/time/

Struct fields and build tags could use a little bit of better standardization, though, with strict syntax and namespacing.

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

Managing environment variables in , python-dotenv or -decouple?

When I need to:

from distutils.util import strtobool
DEBUG = bool(strtobool(os.getenv('DEBUG', 'True')))

...to ensure correct types, I opt out of python-dotenv. Python-decouple (or Pydantic) it is for me :)

orsinium,
@orsinium@fosstodon.org avatar
dabeaz, to random
@dabeaz@mastodon.social avatar

A few weeks back, I showed kid the insides of an Apple 2 and then a box of similarly looking electronic components. He picks out a 7-segment LED and says I want to do something with this.

I'm not sure he knew what he was getting into because all I've got are NAND gates. Figuring out how to represent decimal numbers in binary and displaying a corresponding decimal digit from scratch has proven to be much more involved than it looks. It's actually been a pretty awesome project.

orsinium,
@orsinium@fosstodon.org avatar

@dabeaz

I've done it a while ago! It's a lot of fun if you like math. You make a bool formula for each of the desired states, combine it in one big "or" formula, and then reduce. And this reduction takes most of the time. Putting the hardware gates afterwards is about 20% of total work.

mike, to random
@mike@fosstodon.org avatar

I installed rustc tonight and proceeded to write HelloWorld.rs. My first ever :rust: program. And it's 13MB. What the hell??

orsinium,
@orsinium@fosstodon.org avatar

@mike @underlap

Strange. What's your OS? And regardless of the answer, maybe you can try building in a Linux Docker image and comparing? Let's see if a clean environment gives the right result.

It should give for Linux under 4 Mb for debug builds and under 600 Kb fir release ones. And then there are ways to squeeze more when it matters:

https://github.com/johnthagen/min-sized-rust

I have a real fat Rust project running on PyBadge that is under 300 Kb binary.

dabeaz, to random
@dabeaz@mastodon.social avatar

Current dilemma: Go get a donut now or wait until after I delete all of the SSL related code?

orsinium,
@orsinium@fosstodon.org avatar

@dabeaz

The real question is how much code you can remove without breaking the project. The best days is when you replace everything with a bash one-liner.

snonux, to golang
@snonux@fosstodon.org avatar

Go enums s***k, let's make better ones https://buff.ly/3PsEfbQ

orsinium,
@orsinium@fosstodon.org avatar

@snonux

Here is my implementation of enums for :

https://github.com/orsinium-labs/enum

Type safe, no code generation, no reflection.

dabeaz, to random
@dabeaz@mastodon.social avatar

I wonder how many people would be pissed if I started writing things like lambda int1, int2: int instead of typing.Callable[(int,int), int]? A lot I'd bet. Good.

orsinium,
@orsinium@fosstodon.org avatar

@dabeaz

If you have "from __future__import annotations", you can do much better than that! How about Haskell-like "int > int > int"?

joel, to books
@joel@fosstodon.org avatar

Finished Book 1 (a third) of by Frank Herbert and it is really good so far, I actually feel that watching the movie helps quite a bit to understand some things, they compliment each other well so far.

orsinium,
@orsinium@fosstodon.org avatar

@joel

The first book is one of the best things I've ever read. The second and the third one not so much. The tone of the story shifts a lot from politics and intrigues to prophecies and religion.

metin, to Dragonlance
@metin@graphics.social avatar

🗺️ 𝘖𝘱𝘦𝘯𝘚𝘵𝘳𝘦𝘦𝘵𝘔𝘢𝘱 3𝘋 🧊

https://demo.f4map.com

Zoom in to street level to see the 3D features.

#map #maps #OpenStreetMap #3D #topography #world #WorldMap #cities #landscape #environment #data #tools #OpenSource #FOSS

orsinium,
@orsinium@fosstodon.org avatar
deshipu, to python
@deshipu@fosstodon.org avatar

deleted_by_author

  • Loading...
  • orsinium,
    @orsinium@fosstodon.org avatar

    @deshipu "Flat is better than nested" 😉 Besides, maybe I misunderstand you, but all typing-related stuff is already in a separate namespace: the "typing" module (and "collections.abc").

    tante, to random
    @tante@tldr.nettime.org avatar

    Ada Lovelace was cool, sure. But in the year 2024 maybe find a second woman to name your "women in tech" or "diversity in tech" thing after. Otherwise it looks as if you know exactly one woman.

    orsinium,
    @orsinium@fosstodon.org avatar

    @tante

    My number one woman in tech is Barbara Liskov. She introduced lots of seemingly small things that are the basis of most of the modern programming languages (especially and ): promises, abstract classes, Liskov substitution principle (yes, the name is a giveaway), call by sharing, iterators, parallel assignment, generics, etc. You may not know most of these words but if you write code, you use most of them daily.

    https://en.m.wikipedia.org/wiki/Barbara_Liskov

    https://en.m.wikipedia.org/wiki/CLU_(programming_language)

    aras, to Playdate
    @aras@mastodon.gamedev.place avatar
    orsinium,
    @orsinium@fosstodon.org avatar

    @aras

    1. Why?
    2. How?
    meejah, to python
    @meejah@mastodon.social avatar

    Hey what other information would you like to see in a CLI coverage tool?
    (This shown inside a github action log)

    orsinium,
    @orsinium@fosstodon.org avatar

    @meejah

    Maybe it shouldn't plague this specific dashboard, but I find it very useful to know which functions have 0% coverage. When you have low coverage, it makes sense to first make tests for what functions aren't tested at all ajd only then look at smaller things like uncovered branches or interrupted flow.

    Maybe, you can show the size of the longest continuous not covered chunk?

    orsinium,
    @orsinium@fosstodon.org avatar

    @meejah

    Good idea! The perfect solution is probably a list of functions sorted by the number of uncovered lines. I used to use a golang tool that does exactly that but I can't find it right now.

    orsinium,
    @orsinium@fosstodon.org avatar

    @meejah

    Shouldn't be too hard! You can get each function's range of lines from AST without a problem, and then just group each line coverage into these ranges.

    orsinium,
    @orsinium@fosstodon.org avatar

    @nedbat @meejah

    I'm sure there are! I remember reading the code you wrote for coverage.py, I know it handles lots of things I would never thought of.

    The good news is that I just remembered that I already did mapping of coverage to functions a long time before, and I know for sure that for the common case it works great. Here it is:
    https://github.com/life4/deal/blob/master/deal/_trace.py#L53

    I use it in the test CLI command to show the coverage percent for each tested function:

    https://github.com/life4/deal/blob/master/deal/_cli/_test.py#L124

    orsinium,
    @orsinium@fosstodon.org avatar

    @nedbat @meejah

    You are the one who made this possible. Or at least much easier. It was a long time ago but I think I borrowed most of the logic for formatting the line ranges from coverage.py:

    https://github.com/life4/deal/blob/master/deal/_trace.py#L110-L138

    omenos, to programming
    @omenos@fosstodon.org avatar

    Decided to try and compare the general base program size of several languages. I wrote a handful of Hello World programs, and stripped them of everything. Here's the final results in KiB:

    strip -s -o ${lang}_strip
    du *_strip

    C: 16
    C++: 76
    Go: 1204
    Hare: 220
    Rust: 352

    #c

    orsinium,
    @orsinium@fosstodon.org avatar

    @omenos

    For , you should try @TinyGo. The main Go compiler is designed to prioritize performance and runtime safety over binary size. But TinyGo is designed for small places.

    IDK what's TinyGo Linux binary size for Hello World but we recently optimized a lot for , and a wasm binary hello world with stripped out debug info is something like 40 bytes.

    nedbat, to python
    @nedbat@hachyderm.io avatar

    Just saw someone describe as "strangely easy" :D

    orsinium,
    @orsinium@fosstodon.org avatar

    @nedbat

    Their suspicions are correct. There is a lot of complexity hiding inside, depending on how far you're ready to go. Better just not to think about it.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • ngwrru68w68
  • Youngstown
  • everett
  • mdbf
  • slotface
  • GTA5RPClips
  • khanakhh
  • thenastyranch
  • kavyap
  • ethstaker
  • InstantRegret
  • DreamBathrooms
  • magazineikmin
  • JUstTest
  • cubers
  • rosin
  • tester
  • normalnudes
  • osvaldo12
  • tacticalgear
  • modclub
  • Durango
  • cisconetworking
  • provamag3
  • Leos
  • anitta
  • lostlight
  • All magazines