751
8

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?

752
34
We mourn our craft (nolanlawson.com)
753
97
754
12
755
65

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.

756
16
757
-2
758
-25
submitted 6 months ago* (last edited 6 months ago) by costalfy@programming.dev to c/programming@programming.dev
759
11

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

760
-36

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.

761
42
762
105
763
521

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

764
18
765
17

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.

766
9
767
14
submitted 7 months ago* (last edited 7 months ago) by monica_b1998@lemmy.world to c/programming@programming.dev
768
10
Selfish AI | GarfieldTech (www.garfieldtech.com)
769
4
Dsci runner migrated to golang (deadsimpleci.sparrowhub.io)

Hey everyone! After week of work finally rewrote dsci runner on golang.

git clone https://github.com/melezhik/dsci-runner.git cd dsci-runner go mod tidy go build -o dsci_runner main.go ./dsci_runner

That means just a single binary install Check it out ! )

Forgejo integrations details are here - http://deadsimpleci.sparrowhub.io/doc/forgejo-setup

770
6
Dsci runner migrated to golang (deadsimpleci.sparrowhub.io)

Hey everyone! After week of work finally rewrote dsci runner on golang.

git clone https://github.com/melezhik/dsci-runner.git cd dsci-runner go mod tidy go build -o dsci_runner main.go ./dsci_runner

That means just a single binary install Check it out ! )

Forgejo integrations details are here - http://deadsimpleci.sparrowhub.io/doc/forgejo-setup

771
5

n quest’articolo vediamo come creare l’indice di una guida, supponiamo, sul linguaggio HTML. Apriamo OneCompiler e creiamo il seguente indice:

  1. Il linguaggio HTML

  2. I Tag: cosa sono e come si usano

  3. I commenti

  4. I paragrafi

Per farlo ci serviremo di un elenco numerato, quindi dei tag e il tag di chiusura ed il tag

772
15
Forget technical debt (www.ufried.com)

To be clear: I do not think we should actually forget technical debt. Also, this is not the nth post discussing if “debt” is an appropriate metaphor. I do not have a strong opinion regarding the metaphor. My point is rather that I realized in a recent discussion that in the end, it is not so much about technical debt but rather about something else, and I wanted to share the thought.

773
316
submitted 7 months ago by who@feddit.org to c/programming@programming.dev
774
22
submitted 7 months ago by jdw@feddit.org to c/programming@programming.dev

I've recently started to get into containerized development (of LaTeX documents for now) using VSCode with the Dev Containers Extension. While compilation and everything works fine, I'm a bit annoyed by the very barebones shell of my podman container in the integrated terminal. I'm used to zsh with syntax highlighting and autocompletion, I like to use neovim to write my commit messages (even when I'm using VSCode to write my code) and of course I need git and ssh to push to my git forge.

I wonder if it is recommended to

  1. install neovim, zsh, ssh, git inside the dev container using the package manager (apt in this case) and manually write some config files
  2. Specify the installation of those packages in the Containerfile for my dev container and configure the devcontainer.json to mount my host's config files
  3. Use those tools from outside my dev container somehow
  4. Just not use any convenience tools like zsh, neovim, with individual config even, and only install purely functional packages like git and ssh in the container?

Since I'm not a software developer by training (trying to become one right now) I'd be very happy about some best practices or recommendations.

775
50
view more: ‹ prev next ›

Programming

28304 readers
363 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 3 years ago
MODERATORS