Programming

25438 readers
284 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
3
4
5
6
7
8
9
10
16
Systems Thinking (theprogrammersparadox.blogspot.com)
11
12
13
14
 
 

This is a question regarding the frontend framework Slint

Let's take a web frontend framework as an example like React, Vue, Svelte, and so on. They allow you create components with their own distinct logic and expose an interface with which parents or siblings can react.

(I don't actually write Vue, this is just an example from memory)

<script>
let status = ref("Unknown");
async function onClick(){
  let result = await fetch("https://somewhere.org/");
  status.value = result.json()?status;
  emit("status", status);
}
</script>
<template>
<button @onClick="onClick">Check status</button>
<p>{{ status}}</p>
</template>

How can this be achieved in slint + another language (cpp, python, rust, ...)?

Say, I'm writing a desktop application and have a window, with a 3 column layout, and somewhere deep in the component tree, I have a StatusButton. This button, upon clicking is supposed to execute an IO call in my language of choice and its parent component should react to that. For the sake of the example, make it an HTTP network request that calls a server, expects a JSON with a status field.

How do I create the StatusButton component and use it in slint?

For what it's worth, I use rust, but whichever language the solution is presented in, it can probably be adapted to work in rust.

What I've found (that doesn't work)

slint::slint!( some slint in here ) in rust. This just moves the .slint file into rust but I haven't found out how to use the new component in a .slint file or in another slint::slint!(...) macro

The examples seem to suggest that any non-slint actions have to be passed all the way up to the main component / app window (see example)

Maybe @slint@fosstodon.org can help?

15
 
 

Hello! First of all this is my first Lemmy post, so if I did anything wrong pls tell me!

Now, I'm 19yo in 4th semester of Computer Engineering, and while I'm doing good in college I realized that they give us good background in electronics (from the basics to microcontrollers. ICs. logical design, etc) but the programming aspect is high level and web-oriented (python. java, php)! I appreciate learning those, but I'm not interested on that but rather on a kernel/firmware development! So... I've been learning C for some weeks and while I do love it (mainly been learning from K&R and Zed A. Shaw - Learn C the Hard Way) I don't really know how to practice the skills required to do the proper bridge between hardware and software.

Basically, how does one begin their first real project to learn how to write drivers/baremetal and testing them? Thanks for reading and sorry if my question is dumb, I just feel a bit lost.

16
17
 
 

It's hard to imagine something as fundamental to computing as the sudo command becoming abandonware, yet here we are: its solitary maintainer is asking for help to keep the project alive.

Archived version

18
19
 
 
20
21
22
 
 

Quick update: I added some small but handy improvements to The Hideout:

  1. More accessible GIF & emoji console – now you can type while browsing emojis or GIFs at the same time

  2. Game browser console – see all available games in one place without leaving the room

These make hanging out, reacting, and switching games smoother than ever 😎

Thanks Guys for all the support and feedback it really helps💙

Check it out: https://joinhideout.vercel.app/

Feedback welcome — curious what people like or want next! 💬

23
24
-23
submitted 5 days ago* (last edited 18 hours ago) by costalfy@programming.dev to c/programming@programming.dev
25
 
 

First video on writing code with LLMs I've seen that is actually sensible, is well aware of limitations of LLMs, and gives solid advice.

view more: next ›