Programming

26138 readers
213 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
126
127
128
129
130
131
132
133
134
15
Systems Thinking (theprogrammersparadox.blogspot.com)
135
 
 

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?

136
137
138
139
 
 

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.

140
 
 
141
142
-17
submitted 1 month ago* (last edited 1 month ago) by costalfy@programming.dev to c/programming@programming.dev
143
 
 

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! 💬

144
 
 

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.

145
146
147
 
 

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

148
149
 
 

The Hideout is a browser-based place to play social deduction games with friends or randoms.

What’s in right now:

🕵️ Mafia roles, night/day, voting, chaos

🦎 Chameleon fast bluffing, one player doesn’t know the word

🌐 Public & private rooms

🚫 No downloads, just click and play

It’s meant for quick games, late-night sessions, and arguing over who’s sus.

👉 joinhideout.vercel.app

Feedback welcome. I’m actively building this.

150
view more: ‹ prev next ›