Programming

22676 readers
179 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
1
 
 

Hi all, I'm relatively new to this instance but reading through the instance docs I found:

Donations are currently made using snowe’s github sponsors page. If you get another place to donate that is not this it is fake and should be reported to us.

Going to the sponsor page we see the following goal:

@snowe2010's goal is to earn $200 per month

pay for our 📫 SendGrid Account: $20 a month 💻 Vultr VPS for prod and beta sites: Prod is $115-130 a month, beta is $6-10 a month 👩🏼 Paying our admins and devops any amount ◀️ Upgrade tailscale membership: $6-? dollars a month (depends on number of users) Add in better server infrastructure including paid account for Pulsetic and Graphana. Add in better server backups, and be able to expand the team so that it's not so small.

Currently only 30% of the goal to break-even is being met. Please consider setting up a sponsorship, even if it just $1. Decentralized platforms are great but they still have real costs behind the scenes.

Note: I'm not affiliated with the admin team, just sharing something I noticed.

2
 
 

Soo I'm working on a database that needs to support multiple languages (two for now, but who knows). I stumbled across this blog post that explains how to develop what it calls a "translation subschema" (haven't seen it called like this anywhere else so I don't know if it's actually how you'd call it), which seems like a very nice way of dealing with things.

I'm not very experienced with DB stuff, so it took me a while to fully understand what it was doing, but now that (I think) I do, I'm wondering if I could just ignore the Languages table, and just use a language field in the tables TextContent and Translations, without loosing any functionality. (except of course having a table listing the available languages, which is not however something I'm interested in)

In my head everything would still work, I'd insert stuff with

INSERT INTO TextContent (OriginalText, OriginalLanguage)
VALUES ("Ciao", "it");

DECLARE TextContentId INT = SCOPE_IDENTITY();

INSERT INTO Translations (TextContentId, Language, Translation)
VALUES (@TextContentId, "it", "Ciao");
INSERT INTO Translations (TextContentId, Language, Translation)
VALUES (@TextContentId, "en", "Hello");

and given a TextContentId, i'd retrieve the correct translation with

SELECT Translation FROM Translations WHERE TextContentId = TCId AND Language = "en"

At this point, I'm thinking I could drop TextContent too, and just have a Translations table with TextContentId, Language, and Translation, with (TextContentId, Language) as primary key.

Am I missing something? I'm trying to simplify this solution but I don't want to risk making random errors.

Edit: translations on the DB are for user inserted text, which will also provide translations. The client then will only receive text it the correct language.

3
4
5
 
 

It's been a long time since 2023, when Bun.js arrived and disrupted the JavaScript world. During that time, I was working on something unusual—something that encourages all JS developers to write API code that actually runs on top of Rust.

I gave it my best and eventually published this framework on npm. Many people asked for async support, and after countless sleepless nights, I finally achieved it. Meet Brahma-JS (brahma-firelight) one of my finest creations that replaces Node.js tcp / http module with Rust's Tokio and Hyper library inspired from Deno runtime. Also I tested against the fastest rust frame work may-mini-http.

May-MiniHTTP Benchmarks

Running 10s test @ http://127.0.0.1:8080/
  1 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.70ms  812.42us  20.17ms   97.94%
    Req/Sec   117.65k     7.52k  123.40k    88.00%
  1171118 requests in 10.08s, 115.04MB read
Requests/sec: 116181.73
Transfer/sec:     11.41MB

Brahma-JS Benchmarks

Running 10s test @ [http://127.0.0.1:2000/hi](http://127.0.0.1:2000/hi)
1 threads and 200 connections
Thread Stats   Avg      Stdev     Max   +/- Stdev
Latency     1.51ms  479.16us   7.89ms   78.17%
Req/Sec   131.57k     9.13k  146.78k    79.00%
1309338 requests in 10.00s, 186.05MB read
Requests/sec: 130899.58
Transfer/sec: 18.60MB

Oh sure, just another framework casually doing 130k+ requests/sec. No big deal. Totally normal. Definitely not powered by a Rust beast disguised as friendly JavaScript.

Now I have released v1.5 A stable release with support for Mac, Linux and Windows too. You can give a try by starting

npm i brahma-firelight 

If you find this framework useful plz do share your thoughts and feedbacks.

Npm : https://www.npmjs.com/package/brahma-firelight

Github: https://github.com/Shyam20001/rsjs

6
 
 

Scrolling through this webpage is an adventure.

7
 
 

I've used neovim for a couple years now, but had trouble using it professionally because package managers often break in certain environments like docker containers or remote servers. Rather than go with the graybeard option of using plain vim in unusual environments, I experimented with not using any package managers and just directly controlling the environment.

This worked surprisingly well, so I reworked my dotfiles into a shareable format - which is freak.nvim

Hope other vim appreciators enjoy =)

8
 
 

I find this useful for finding Docker image tags for images that don't list the versions and instead suggest people to use :latest.

9
 
 

Hi everyone,

we, the iceoryx community, just released iceoryx2 v0.7, an ultra-low latency inter-process communication framework for Rust, C, C++ and with this release, Python.

If you are into robotics, embedded real-time systems (especially safety-critical), autonomous vehicles or just want to hack around, iceoryx2 is built with you in mind.

Check out our release announcement for more details: https://ekxide.io/blog/iceoryx2-0-7-release

And the link to the project: https://github.com/eclipse-iceoryx/iceoryx2

10
11
12
13
14
 
 

Specifically, I'm interested in BEAM, but I'm not sure if I should go for Elixir or Gleam. What seems cool about Gleam is that it has static typing.

I have no experience with functional programming at all btw

15
16
 
 
17
 
 

I've installed VSCode Web via docker on my local server at home and would like to open my production server through the editor. How do I do that? Is it even possible?

18
19
20
 
 

cross-posted from: https://programming.dev/post/37202205

Comments

21
22
 
 

After months of hard work. Now we are happy to announce that brahma-firelight v1. 5 is out. I tried to make the best Rust based memory safe framework for JS inspired from deno runtime. Finally I achieved it by utilizing napi-rs and tokio with hyper http library. When I performed benchmarks brahma-firelight v1. 5 against bun's elysia on c6i_x4 instance with 16cpus Reaching 1257k Reqs in 11s. My framework literally performed 20% better than elysia. I'll be sharing the bench marks soon. You can check the npm registry by searching directly npm i brahma-firelight

Give a try I made lot of effort in writing this addon with express js ergonomics. Now any js dev can write Rust code without rust that's the Beauty of brahma-firelight. Give a try and share your feed back thanks.

23
24
 
 

cross-posted from: https://programming.dev/post/36983916

Freund wasn’t looking for a backdoor when he noticed SSH connections to his Debian testing system taking 500 milliseconds longer than usual. As a database engineer benchmarking PostgreSQL performance, he initially dismissed the anomaly. But the engineer’s curiosity persisted.

The backdoor’s technical sophistication was breathtaking. Hidden across multiple stages, from modified build scripts that only activated under specific conditions to obfuscated binary payloads concealed in test files, the attack hijacked SSH authentication through an intricate chain of library dependencies. When triggered, it would grant the attacker complete remote access to any targeted system, bypassing all authentication and leaving no trace in logs.

The backdoored versions 5.6.0 and 5.6.1 had been released in February and March 2024, infiltrating development versions of Fedora, Debian, openSUSE, and Arch Linux. Ubuntu’s upcoming 24.04 LTS release, which would have deployed to millions of production systems, was mere weeks away.

The technical backdoor was merely the final act of a three-year psychological operation that began not with code, but with studying a vulnerable human being.

25
view more: next ›