help-circle
rss
cross-posted from: https://lemmy.onlylans.io/post/111903 > I've always understood the concept of compilers turning high-level languages into assembly for CPUs to actually execute, but I've never really considered how that sausage is made. > > In this video series Pixeled pulls back that curtain and describes the logic and rationale on how compilers are actually created for high-level languages.
fedilink

Super helpful for me as I'm starting my Rust journey.
fedilink


![](https://dubvee.org/pictrs/image/59fc6c48-bf63-45c0-b380-0ea5872e6c75.png)
fedilink

any good github copilot alternatives?
Copilot is great, but a hundred bucks for what is basically a smart autocomplete seems a bit much - mostly, I *hate* the fact that the code is constantly transmitted to github (my repos are mostly local) - are there any reasonably convenient options for doing this without github looking over my shoulder all the time? I'm using VSCode but not wedded to it.
fedilink

Learnable Programming (Blog from 2012)
cross-posted from: https://lemmy.one/post/2707178 > An interesting blog post that reflects some ideas I've been thinking about lately. > > Since nothing close to the environment described in the article has entered the mainstream since ten years, it's safe to say that it's probably too hard or maybe too inconvenient. > > I'd still like programming to go into this general direction, our tooling is really limited in comparison with how complex software has become.
fedilink

There’s nothing like a good hands-on to understand what your tools are doing under the hood. Also, the author admitted that he used ChatGPT to help write this. In [his words](https://news.ycombinator.com/item?id=36489234): > Yep, I do use GPT as one of the tools in my workflow. I write these blogs in markdown locally and have a helper script which takes the raw content and with a prompt it helps me generate a title, summary, Intro and conclusion (personal preference to keep these consistent on all blogs) and proofread the whole raw content for any mistakes (replaces grammarly completely now). > > Quite happy with this workflow because it helps me publish articles more frequently where I don't have to worry about stuff other than just dumping my thoughts in raw format. > > It’s similar to how I use Astro as a tool to generate static pages from these markdown files to easily deploy on web or TailwindCSS etc etc you get the point.
fedilink

Qt 6.7 is out with lots of large and small improvements for all of us who like to have fun when building modern applications and user experiences. Several additions are released as technology previews, and we are looking forward to your feedback so that we can get everything ready for the next LTS release!
fedilink
9

There is a request for a comment on this issue [Controversial posts and comments #2515](https://github.com/LemmyNet/lemmy/issues/2515). Do you have any ideas on how best to implement this? > I'd like to see some more people chime in with opinions, but maybe that'll come with a PR. At the very least, it's something that can be moved forward with. > > [— dcormier](https://github.com/LemmyNet/lemmy/issues/2515#issuecomment-1595287022)
fedilink

Merklizing the key/value store for fun and profit | Joel Gustafson
Prolly Trees and their cousin #Merkle Search Trees are new ideas but are already used by #ATProto / #BlueSky, #Dolt, and others.
fedilink

In the existing implementation in the C++ library, the code does a series of tests to see how many items it needs to sort and calls the dedicated sorting function for that number of items. The revised code does something much weirder. It tests if there are two items and calls out to a separate function to sort them if needed. If it's greater than two items, the code calls out to sort the first three items. If there are three items, it returns the results of that sort. If there are four items to sort, however, it runs specialized code that is extremely efficient at inserting a fourth item into the appropriate place within a set of three sorted items. This sounds like a weird approach, but it consistently outperformed the existing code.
fedilink


Tips for improvement in a small company environment?
Hey all, I am a software developer at a small company where I'm one of two developers. The other dev is primarily back-end and has been working off some basic cloud infra set up by an external company before I joined, so I'm essentially running solo on the frontend, some of the backend, cloud architecture, project management, etc. (really, everything except database management some of the existing api endpoints). So, what are the best ways to improve in this scenario? How do you prevent a limited learning environment from limiting your growth? Has anyone been in a similar situation and learned some tips for making the best of it? Any ideas? (Also, I know it's frequent advice to just say "move companies" but this job is a really unique opportunity, and I absolutely love the company, so I am not interested in doing that.) Thanks :)
fedilink

In my opinion any one of these books may be worth $25 or more, but if you are interested in any one of the 5 in the $1 bundle, this is an easy decision.
fedilink

cross-posted from: https://programming.dev/post/6470590 > This looks like a great starting point for people with little to no experience with programming to learn to program using Python. > > Everything taught by futurecoder.io can be used locally on your own computer. But futurecoder.io doesn't show you how to install Python on your machine but you can fill in that gap with the information provided @ https://wiki.python.org/moin/BeginnersGuide/Download > > Other resources are provided on the [python.org Beginners Guide > ](https://wiki.python.org/moin/BeginnersGuide) if needed. > >
fedilink

Which programming languages do you use?
It seems like there are about ~~22~~ ~~27~~ ~~46~~ ~~219~~ ~~320~~ ~~493~~ 1840 active subscribers here. I have a few questions for you all. - Which programming languages do you regularly use? - Which are your favorite to work with and why? - Which do you have interest in trying and why?
fedilink


Unable to start lemmy docker
I would like to contribute to lemmy but I have issue with the docker image. I got this error when trying to execute docker-compose up : "ERROR: Service 'lemmy' failed to build: the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled" I executed the commands that was in the link in the error message and I still have the same issue.
fedilink

Lemmy is in serious need of more devs
After [the (temporary) defederation announcement of earlier](https://beehaw.org/post/567170) i checked [the Lemmy repo](https://github.com/LemmyNet/lemmy/issues) to see if there was already a ticket on the federation limiting option like Mastodon's that people mentioned Lemmy doesn't yet have. Not only i didn't find it, i also saw that there's about 200+ open tickets of variable importance. Also saw that it's maintained mostly by the two main devs, [the difference in commits between them and even the next contributors is vast](https://github.com/LemmyNet/lemmy/graphs/contributors). This is normal and in other circumstances it'd grow organically, but considering the huge influx of users lately, which will likely take months to slow down, they just don't have the same time to invest on this, and many things risk being neglected. I'm a sysadmin, haven't coded anything big in at least a decade and a half beyond small helper scripts in Bash or Python, and haven't ever touched Rust, so can't help there, but maybe some of you Rust aficionados can give some time to help essentially all of Lemmy. The same can be said of Kbin of course, although that's PHP, and there is exacerbated by it being just the single dev.
fedilink

(C++) Does anyone know the difference between Critical sections and Reduction in OpenMP?
Hi, I'm studying for an exam coming up soon and I'm trying to figure out what is the functional difference between these two approaches: ``` #pragma omp parallel for for(unsigned int i = 0; i < G.Out.bucket_count(); i++){ for(auto itv = G.Out.begin(i); itv != G.Out.end(i); itv++){ unsigned int v = itv->first; #pragma omp parallel for for(unsigned int j = 0; j < G.Out[v]._map.bucket_count(); j++){ for(auto ite = G.Out[v]._map.begin(j); ite != G.Out[v]._map.end(j); ite++){ unsigned int w = ite->first; if(o[v] > o[w]) #pragma omp critical p[o[v]] = min(p[o[v]],o[w]); } } } ``` and ``` #pragma omp parallel for for(unsigned int i = 0; i < G.Out.bucket_count(); i++){ for(auto itv = G.Out.begin(i); itv != G.Out.end(i); itv++){ unsigned int v = itv->first; if(p[v] == v){ unsigned int parent = v; //=p[v] #pragma omp parallel for reduction(min : parent) for(unsigned int j = 0; j < G.Out[v]._map.bucket_count(); j++){ for(auto ite = G.Out[v]._map.begin(j); ite != G.Out[v]._map.end(j); ite++){ unsigned int w = ite->first; if(v > w) parent = min(parent,w); } } p[v] = parent; if(p[v] != v) changes = 1; } } } ``` In the first example, the minimum between the two values is calculated using a critical section, while the second one uses a reduction. Both work, and they seem equivalent to me, when would one choose one or the other? Thanks, and sorry if the question is too niche. Any other info about OpenMP is greatly appreciated :D
fedilink

Help with Lemmy bot
Hello fellow Lemmings! I'm trying to develop a Lemmy bot that reads posts and comments using the [lemmy-bot](https://github.com/SleeplessOne1917/lemmy-bot) library. So I created a new Node.js project, installed the library, and wrote this: ```js import LemmyBot from 'lemmy-bot'; const LEMMY_USERNAME = process.env.LEMMY_USERNAME; const LEMMY_PASSWORD = process.env.LEMMY_PASSWORD; const LEMMY_INSTANCE = process.env.LEMMY_INSTANCE; const bot = new LemmyBot.LemmyBot({ // Pass configuration options here credentials: { username: LEMMY_USERNAME, password: LEMMY_PASSWORD }, instance: LEMMY_INSTANCE, federation: "all", dbFile: 'db.sqlite3', handler: { comment: { handle: ({ commentView: { comment: { creator_id, id } }, botActions: { createComment } }) => { console.warn("new comment:") } }, post: { handle: (x) => { console.warn("new post", x) } } } }); bot.start() ``` and then I run it: `node index.js` this is the output: ``` Connected to Lemmy Instance Initializing DB Logging in Marking account as bot account Subscribing to communities ``` and then stops there. I waited a lot and nothing, not a single log. credentials are correct, because otherwise it wouldn't login. the bot is using an account hosted on sh.itjust.work, so there should be plenty of activity (I tried adding comments manually but nothing was detected) What am I doing wrong? thanks in advance
fedilink

Could a malicious user bring down small lemmy instances by over-subscribing?
I just read how the federation works, but I'm worried about a growing pain. Say I was a malicious user, could I bring down a smaller Lemmy instance by subscribing to as many communities as possible? Or maybe even subscribing to a malicuous Lemmy instance that keeps spamming thousands of posts every second? Couldn't that easily fill up a server's storage and effectively bring a server down? I guess you could block the malicious Lemmy instance (although wouldn't it be easy to create another?) and ban a user that subscribes to too many instances, however, it feels to me like a very hard problem to solve
fedilink

Am i missing out if I dont use an IDE?
So, I have been mostly self thaught programmer (C++), as its a big part of my job (not a regular developer). But so far I have been using a simple text editor like Geany to code and I compile stuff either in terminal (linux) or produce my own make file. I am starting to wonder if I should switch to a full IDE, as I am on linux, I was thinking of trying KDevelop. But I am simply not sure if its worth, do I even need it? I have never used an IDE, it seems kind of complicated for the start with "projects" and I havent really found any good introductions to how this workflow is supposed to work. Do you think using and IDE is something everyone should use? Or do you think a text editor with producing your own make files should be enough?
fedilink

Some people pronounce SQL as “sequel”, and some as “squeal”
...But I've only ever heard SSL pronounced as its three letters. Why not like "Cecil"? Or "Sizzle"? 🤔
fedilink

Seriously, though, Comic Sans was originally designed to be legible at the smallest possible font size, and the lack of hard lines makes it easier to read!
fedilink

I'm confused about how I can link Mastodon and Lemmy sites, say. I have an account on Fosstodon. Can I use it to access and post to [https://beehaw.org/c/programming](https://beehaw.org/c/programming) for example? I can follow [@programming](https://beehaw.org/c/programming) but that's not the same thing? The beehaw site says to search for !programming@beehaw.org but this returns nothing (with the ! prefix) on fosstodon. Am I missing something? [#lemmy](https://fosstodon.org/tags/lemmy) [#fediverse](https://fosstodon.org/tags/fediverse) [#beehaw](https://fosstodon.org/tags/beehaw)
fedilink

Have you ever wondered what happens behind the scenes when you write a C program? How does your code transform from lines of text into a fully functional binary executable? If you’ve been curious about the intricacies of the C program compilation process, you’ve come to the right place.
fedilink


Was anyone else surprised to see Kbin being written in PHP?
I don't know if it's due to over-exposure to programming memes but I certainly believed that no one was _starting_ new PHP projects in 2023 (or 2020, or 2018, or 2012...). I was under the impression we only still discussed it at all because WordPress is still around. Would a PHP evangelist like to disabuse me of my notions and make an argument *for* using PHP for projects such as Kbin in this day and age?
fedilink

Thoughts on Lemmy sorting options?
Hello all, Wanted to open a discussion on Lemmy's post sorting options right now. I don't have any experience with implementing this type of thing but right now the algorithm appears... Off? For example, 'Active' gives me a lot of posts over a day old but 'Hot' may as well be 'New' i.e. more recent posts with little engagement. I don't know if it's due to Lemmy still picking up steam or a fundamental flaw with the algorithm. Like I said, I'm really curious to hear the opinions of those more knowledgeable.
fedilink






Programmers using Spring (Java) professionally, how did you learn it?
Would you recommend courses, books, documentation, or jumping straight to a project and googling things along the way? I have a solid foundation of Java and want to start learning how to develop web apps with it. Any help much appreciated
fedilink

What is considerd a small idea/project and how do you all find motivation?
(warning lots of wordy words) I feel like i stink at everythign and im limited to what my low end pc can do it use to be an office pc but it got refurbished and whatnot (still low end). I usally just go to chatgpt to learn coding and youtube too but i guess thats the lazy way of the coder and i use chatgpt to code to becasue i stink at everything. i have no talent, skills or good hobbys and im dylexic and autistic but yet for some reason and im not sure why i want to make a game. I just feel very lost with things like wanting to make a game i even made a post asking what engine or framewrok i should use most said godot, python, love2d mostly but im not sure how to start its like some werid form of writters block with the fear and guilt of failing gamedev. i tried making a endless runner in godot but i coudent get the player to stand on the platform without falling thru so i raged quite and gave up.... but i still have the urge to create or be creative.
fedilink

What is the best game engine/framework for a absolute beginner to learn?
So ive tried to code many times on my own but i feel like im doing things the hard way and im still unsure what to pick becasue ive been jumping around here and there. like most gamers i would like to try to make a game or something but im just not sure if i can or not becasue it seems really hard to do and im not sur eif ill enjoy it or not also my pc is low end so im kinda limited to say.
fedilink

What are the best open source game engines? that can work on a potato…
So what good open source game engine sare out there i know about things like godot but are there any others? i keep wanting to make a game but coding just gos right over my head but still i want to mak eone. it dosent help how my pc is low-end-ish (8gb of ram, windows 10, nvidia 1030 card). im not even sure how to code or if there is a more visaul way to make games, i would prefer 2d btw becasue it seems easyier for beginner. im not even sure why i want to make a game but i just do maybe becasue im a nerd-ish and it give sme a goal/hobby. also please share anything you feel is needed aswell and remeber im bascily a absolute beginner who dreams way too big.
fedilink

AlphaDev uncovered new sorting algorithms that led to improvements in the LLVM libc++ sorting library that were up to 70% faster for shorter sequences and about 1.7% faster for sequences exceeding 250,000 elements.
fedilink

    Create a post

    All things programming and coding related. Subcommunity of Technology.


    This community’s icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

    • 0 users online
    • 3 users / day
    • 3 users / week
    • 35 users / month
    • 73 users / 6 months
    • 2 subscribers
    • 299 Posts
    • 2.4K Comments
    • Modlog
    Beehaw
    Aspiring to be(e) a safe, friendly and diverse place.

    We’re a collective of individuals upset with the way social media has been traditionally governed. A severe lack of moderation has led to major platforms like Facebook to turn into political machinery focused on disinformation campaigns as a way to make profit off of users. Websites with ineffective moderation allow hate speech to proliferate and contribute to the erosion of minority rights and safe spaces. Our goal with Beehaw is to demonstrate and promote a healthier environment.

    Our philosophy:

    Downvotes are disabled on this instance.

    Be(e) nice.


    As a news aggregator and a social media outlet, with a focus on being a safe and accepting space, we strive to create a positive social impact. We will, also, help to connect underprivileged and minority individuals with education and civic participation by promoting a healthier online experience.


    We currently have a Mastodon account you can follow for major updates: @beehaw at hachyderm.io. You can also join our community Discord or Matrix servers. You can also view our status page.


    Our instance is 100% user-funded - help us keep it running by donating.

    If you donate, you should know that 100% of the costs will go towards server time, licensing costs, and artwork.

    In the future if we need to hire developers or other labor, it would be sourced through the Open Collective Europe Foundation, and it would be transparent to the community before any changes were made.

    Donate on Opencollective


    Our community icons were made by Aaron Schneider under the CC-BY-NC-SA-4.0 license.

    Blobbee emojis made by olivvybee on Github.

    Our most up to date FAQ can be found here.


    if you can see this, it's up