Programming Leftovers

-
Powering inheritance in C using structure composition
C language does not support inheritance however it does support Structure Compositions which can be tweaked to serve use-cases requiring parent-child relationships. In this article, we find out how Structure Compositions help us emulate inheritance in C and keep our code extensible. We will also find how it powers two of the most important things to have ever been invented in the field of computer science.
[...]
In order to keep things abstract and extensible, Linux Kernel uses Structure Composition at several places. One of the most important places where it uses composition is for managing and maintaining Linked Lists, exactly how we saw things above. The struct definitions and code snippets are taken as-is from the Kernel's source code, and hence the structure and variable names look different than usual.
-
CMake & Meson & CompCert
I tried to compile the Picolibc that uses the Meson build system with CompCert.
The CompCert install I tried uses the GNU/GCC toolchain for preprocessing and linking. That makes the compiler relatively compatible to a GCC, beside that not all command line options are supported.
I was used to CMake projects and there it is normally enough to just set CC=ccomp and you are ready and set (at least if you use the GNU/GCC toolchain). As long as you don’t use special flags in your project, that will just work.
The Picolibc was the first Meson based project I encountered.
-
Aurélien Bompard: Reviews are hard
It’s a vast subject, but one thing is certain: reviewing other people’s code is hard. Because good mentoring require technical and non-technical skills (such as patience).
I would like to dive directly into a specific detail of code reviews. It’s an iterative process: author submits code for review, reviewer make suggestions, author amends or pushes more code, reviewer make different or more suggestions, and so on.
In Git, « more code » takes the form or one or more commits appended to the Pull Request (or Merge Request if you use Gitlab, for simplicity I’ll just use « Pull Request » in this piece). And « amended code » means overwriting existing commits and force-pushing, which makes the old commits disappear.
As a reviewer, it can be very annoying because what I first look for in an update is whether my suggestions have been implemented or not, and how. That’s why authors are sometimes encouraged to push new commits in their Pull Requests and never overwrite existing ones. It makes the reviewer’s job way easier, because the UI can just show the new commit and they’ll know what’s changed.
-
How to Contribute to Open Source: The Ultimate Guide
Open source is everywhere.
It’s in proprietary apps and your favorite online encyclopedia. It’s happening at huge corporations and also at The Onion. From novel drug discovery to wedding invitations, you can’t avoid open source, so might as well help develop it.
Even better, involvement with open source can supercharge your career.
-
OpenZFS: Understanding Transparent Compression
Transparent (inline) configurable compression is one of OpenZFS’ many compelling features—but it is also one of the more frequently misunderstood features. Although ZFS itself currently defaults to leaving compression off, we believe you should almost always use LZ4 compression on your datasets and zvols. There is such wide acceptance of this idea, that the default compression setting is likely to change in a future release of OpenZFS.
-
yubikey-agent on FreeBSD
Some time ago Filippo Valsorda wrote yubikey-agent, seamless SSH agent for YubiKeys. I really like YubiKeys and worked on the FreeBSD support for U2F in Chromium and pyu2f, getting yubikey-agent ported looked like an interesting project. It took some hacking to make it work but overall it wasn’t hard. Following is the roadmap on how to get it set up on FreeBSD. The actual details depend on your system (as you will see)
-
Let's make a Teeny Tiny compiler, part 1
It is a beautiful day outside, so let's make a compiler. You don't need any knowledge of how compilers work to follow along. We are going to use Python to implement our own programming language, Teeny Tiny, that will compile to C code. It will take about 500 lines of code and provide the initial infrastructure needed to customize and extend the compiler into your own billion dollar production-ready compiler.
This tutorial is a series of posts that go step by step in building a working compiler. All of the source code can be found in the GitHub repo. If you follow along with all the posts, I guesstimate that it will take you only a few hours.
The Teeny Tiny language we are going to implement is a dialect of BASIC. The syntax is clean and simple. If you prefer a C-like syntax then it will be trivial to modify the compiler at the end. Here is an example program in our Teeny Tiny language: [...]
-
Let's make a Teeny Tiny compiler, part 2
It is a rainy day outside, so let's continue working on our Teeny Tiny compiler. Go read part 1 if you haven't already and don't forget that the source code can be found in the GitHub repo. This part of the tutorial does need a bit of upfront explanation, but I hope you stick with it because we are well on our way to completing our compiler!
To recap, we are making a compiler for our own programming language, Teeny Tiny. The compiler will work in three stages: (1) lexing, which breaks the input code up into small pieces called tokens, (2) parsing, which verifies that the tokens are in an order that our language allows, and (3) emitting, which produces the appropriate C code. We finished the lexer in part 1, so now we will be focusing on the parser.
-
AcceleratXR, Today Announced the Launch of Its New Open Source project; Composer.js
AcceleratXR, Inc. announced the launch of its new open source project; Composer.js. Composer.js is a framework and toolset for rapidly building back-end API services using NodeJS. The project is a fork of the internal tools and technology the company has been steadily building its innovative MMO gaming platform with over the last two years.
-
Weekly Report 1 by Paritosh Sharma
The coding period for GSoC officially started on 1st of June. My project aims at adding a 3D based backend to KStars which currently utilizes QPainter to render the realtime night sky in 2D.
-

- Login or register to post comments
Printer-friendly version- 2604 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
digiKam 7.7.0 is released
After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release.
|
Dilution and Misuse of the "Linux" Brand
|
Samsung, Red Hat to Work on Linux Drivers for Future Tech
The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world.
Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility.
|
today's howtos
|








.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.

GSoC progress reports in Python
PSF GSoC students blogs: Week 1 : Adding Fastkml Support
PSF GSoC students blogs: Week 1 Blog Post
PSF GSoC students blogs: Week 2 Check-in
PSF GSoC students blogs: Weekly Blog Post #1
PSF GSoC students blogs: Weekly Check-In: Week 2
PSF GSoC students blogs: Weekly Check-in #2
PSF GSoC students blogs: Weekly Post #1 ( 1st June - 7th June)
More GSoC progress reports in Python
PSF GSoC students blogs: Week 2 Check-in
PSF GSoC students blogs: Week 1 Check-in
PSF GSoC students blogs: GSoC: Week #2
PSF GSoC students blogs: GSoC 20: Week 2: del legacy.c
PSF GSoC students blogs: GSoC 2020 Blog Post (#1)
PSF GSoC students blogs: Brainstorming ideas - Weekly Check-in 2
More GSOC
PSF GSoC students blogs: Weekly Check-In #2
PSF GSoC students blogs: Week #2
PSF GSoC students blogs: GSoC Week 2: except Exception as opportunity_to_learn:
PSF GSoC students blogs: GSoC Weekly Blog #1
PSF GSoC students blogs: Laying out the foundations for the EOS feature request system in GSOC’20
GSoC progress reports in Python
PSF GSoC students blogs: Weekly Check-in #2
PSF GSoC students blogs: Week 2 blog!
PSF GSoC students blogs: Unexpected Things When You're Expecting
PSF GSoC students blogs: Blog post for week 1: Introducing support for Redis