General Programming Discussion

7782 readers
1 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 5 years ago
MODERATORS
1
 
 

Hey all.

First off, bjForth is a Forth written from the ground up with modern Java and its execution model is largely influenced by that of JONESFORTH.

Currently I'm working on Java inter-op and would like to ask for your opinions/experience on semantics and syntax.

The relevant GitHub issue.

Thanks in advance.

2
 
 

Pretty straightforward: what tips and advice would you give me if I were to start an open source project of a game? Where to share my intention of beginning this project, where to find contributors, how to organize the workflow etc.

3
 
 

bmakelib (which is a minimalist standard library for GNU Make) v0.8.0 was released last week.

The highlight of the release is the ability to use maps/dictionaries in your makefiles!

Here's the example from the release page:

$(call bmakelib.dict.define,THIS_BUILD)
$(call bmakelib.dict.put,THIS_BUILD,arch,x86_64)
$(call bmakelib.dict.put,THIS_BUILD,dir,/tmp/my-app/build)

some-target :
	@echo BUILD.arch = $(call bmakelib.dict.get,BUILD,arch)  # x86_64
	@echo BUILD.arch = $(call bmakelib.dict.get,BUILD,dir)   # /tmp/my-app/build
4
0
submitted 4 months ago* (last edited 4 months ago) by [email protected] to c/[email protected]
 
 

If there was one reason I liked coding in Java, it'd be AssertJ and its brilliant extensibility.

The image is an example of it from bjForth

The ability to create custom assertions makes the test code concise and read naturally.

5
 
 

The Open Source Initiative (OSI) released the RC1 (“Release Candidate 1” meaning: This thing is basically done and will be released as such unless something catastrophic happens) of the “Open Source AI Definition“.

Some people might wonder why that matters. Some people come up with a bit of writing on AI, what else is new? That’s basically LinkedIn’s whole existence currently. But the OSI has a very special role in the Open Source software ecosystem. Because Open Source isn’t just based on the fact whether you can see code but also about the License that code is covered under: You might get code that you can see but that you are not allowed to touch (think of the recent WinAmp release debate). The OSI basically took on the role of defining which of the different licenses that were being used all over the place actually are “Open Source” and which come with restrictions that undermine the idea.

This is very important: Picking a license is a political act with strong consequences. It can allow or forbid different modes of interaction with an object or might put certain requirements to the use.

6
7
8
1
submitted 5 months ago* (last edited 5 months ago) by [email protected] to c/[email protected]
 
 

I'm working on a python program, and i need to sync the results to an ipad as a todo list (with checkboxes)

I had been using google keep, and manually copying /pasting the data over from my cli based app.

I will be out of the country for 2 weeks, so im updating my software to no longer being cli, and ideally syncing the final list to google keep or something similar, since someone else will be running the software. You know how normies get when they see a terminal window...

I tried this googlekeepapi thing i found online, but the authentication was very complicated and i couldn't get it to work. There is no specific reason we need to use google keep, was just the first thing that came to mind when we set this system up, and it works well and is cloud based.

Do yall know of any service where i can programmatically generate checkbox lists, and sync them over the web?

I should note i do not have a server available to self host. I could potentially spin something up locally with a raspberry pi, but would prefer not to have another potential point of failure.

9
10
11
12
 
 

Hi! I'm having a bit of a struggle with VSCodium. I'm not sure what I did, but I can't access the liveserver in my browser, and the extensions won't load to download them. I keep getting "Error fetching extensions. Failed to fetch" So that's been frustrating. Are there any fixes? What's a good VSCodium alternative I could try?

13
 
 

I've made a very simple and primitive JavaScript canvas engine that is simply not dependent on time, as in it assumes that t = 1 in the formula v = u + at - v is the current velocity, u the initial velocity and a is acceleration due to gravity.

Now, the issue with this method is that if the value of gravity, or velocity is large enough that the object it should collide, it just goes right through it. Now, I have been told that if time was a parameter, we could just increase the frame rate and dilate the time to resolve this, but this would mean that the engine would no longer be deterministic - as in, the simulation would not work out the exact as it we assumed it to be, owing to hardware and software requirement like decimal point handling and precision.

How can we deal with this issue on this simple deterministic engine, and improve collision detection?

14
 
 

OGRE has grown to become one of the most popular open-source graphics rendering engines. It’s been 2 years since 2.3.0 and almost a year since the last 2.3.x release. It’s about time for 3.0.0!

  • Ogre to OgreNext name migration
  • Dealing with ABI mismatches: AbiCookie
  • ABI Semver
  • Move to C++11 and general cleanup
15
 
 

The GNU Compiler Collection (GCC) support for the C23 programming language standard is now considered "essentially feature-complete" with GCC 15. As such they are preparing to enable the C23 language version (using the GNU23 dialect) by default for the C language version of GCC when not otherwise specified.

Preparations are now underway to set the default C language version of GCC to GNU23 as the GNU dialect of C23. Or in other words, implying -std=gnu23 when no other C standard is specified.

16
 
 

This new edition has been the occasion to overhaul the presentation in many places, but its main purpose is the update to the new C standard, C23. The goal was to publish this new edition of Modern C at the same time as the new C standard goes through the procedure of ISO publication. The closest approximation of the contents of the new standard in a publicly available document can be found here. New releases of major compilers already implement most of the new features that it brings.

17
 
 

So far, I've followed a simple Tor interceptor tutorial on YouTube, while strictly adhering to C2x with every warning flags enabled - not that it is the optimal way to go about learning the language.

I may have, or may not have inadvertently used improper C2x, but I've used typedef aggressively to slightly mimic Golang.

Almost a year ago, I had blindly translated a C++ Vulkan tutorial to C, and I didn't understand a single thing about anything graphics-related - framebuffer, swapchain, etc.

Now that I am learning it again from scratch, I also wanted to know what to learn next, as well as some of the job opportunities that I can explore.

18
 
 

RINA offers a lot of

19
20
 
 

This is a simple experimental Lisp compiler, written in uLisp, that will compile a Lisp function into RISC-V machine code. You can run the compiler on the RISC-V core of a Raspberry Pi Pico 2 (or another RP2350-based board)

21
22
 
 

We are thrilled to announce the release of Qt 6.8, packed with support for new desktop, mobile, and embedded platforms, hundreds of improvements, and exciting new features to boost your development experience and meet the needs of demanding applications.

For this release we have focused on improving and stabilizing existing functionality. With over 500 bug fixes and performance improvements since Qt 6.7, your existing code will run better without changing a single line. On macOS, Qt Quick applications now integrate with the native menu bar, and for a native Windows 11 look they can use the new Fluent style. Resizing Quick windows is snappier on macOS with Qt 6.8, and on Windows the application start-up time has been improved by changing the default font database to DirectWrite.

Several modules that were under technology preview have been completed: Qt Graphs, Qt HttpServer, and Qt GRPC are promoted to be fully supported from this release on. Thanks to the feedback from our users we were able to finish those modules with substantial improvements since their initial introduction as technology previews.

23
 
 

cross-posted from: https://lemmy.ml/post/21033409

In the book authored by K.N.King, there's this example:

viewmemory.c

/* Allows the user to view regions of computer memory */

#include <stdio.h>
#include <ctype.h>

typedef unsigned char BYTE;

int main(void)
{
	unsigned int addr;
	int i, n;
	BYTE *ptr;
	
	printf("Address of main function: %x\n", (unsigned int) main);
	printf("Address of addr variable: %x\n", (unsigned int) &addr);
	printf("\nEnter a (hex) address: ");
	scanf("%x", &addr);
	printf("Enter number of bytes to view: ");
	scanf("%d", &n);
	
	printf("\n");
	printf(" Address               Bytes             Characters\n");
	printf(" ------- ------------------------------- ----------\n");
	
	ptr = (BYTE *) addr;
	for (; n > 0; n -= 10) {
		printf("%8X  ", (unsigned int) ptr);
		for (i = 0; i < 10 && i < n; i++)
			printf("%.2X ", *(ptr + i));
		for (; i < 10; i++)
			printf("   ");
		printf(" ");
		for (i = 0; i < 10 && i < n; i++) {
			BYTE ch = *(ptr + i);
			if (!isprint(ch))
				ch = '.';
			printf("%c", ch);
		}
		printf("\n");
		ptr += 10;
	}
	
	return 0;
}

For some reason, when I try to enter addr variable address as the parameter, it has a segmentation fault error. However, in the book's example and the screenshot from this site in Hangul, there's no such error?

When I try using gdb to check the issue, here's what I get:

gdb

$ gdb ./a.out  --silent
Reading symbols from ./a.out...
(gdb) run
Starting program: /home/<username>/Desktop/c-programming-a-modern-approach/low-level-programming/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libthread_db.so.1".
Address of main function: 401166
Address of addr variable: ffffd678

Enter a (hex) address: ffffd678
Enter number of bytes to view: 64

 Address               Bytes             Characters
 ------- ------------------------------- ----------

Program received signal SIGSEGV, Segmentation fault.
0x000000000040123a in main () at viewmemory.c:31
warning: Source file is more recent than executable.
31	        printf ("%.2X ", *(ptr + i));
(gdb)

What is going on? By the way, I am using Guix, if that matters in any way. Here's the output for ldd:

ldd

$ ldd ./a.out 
	linux-vdso.so.1 (0x00007ffecdda9000)
	libgcc_s.so.1 => /gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj16-gcc-11.4.0-lib/lib/libgcc_s.so.1 (0x00007fcd2627a000)
	libc.so.6 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libc.so.6 (0x00007fcd2609c000)

24
 
 

Recently I wondered what I get in term of C++ features for upgrading my system from version 13 to 14 of GCC...

Now, of course - a lot of bug fixes. Its surely a good idea to upgrade. But that doesn't answer my question. So a quick look at C++ compiler support showed that there is some interesting features, and mostly first C++26 support becoming available is one of them. Other features are more important to me though.

25
view more: next ›