Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
jai will drop at the same time
Source?

It's funny how in the release announcement for the game on YouTube, there are possibly more comments about Jai than the game itself. I can imagine the game will primarily be known for being written in Jai instead of its gameplay. Jon would be pissed. Soulja Boy strikes again.
Make is the way to go.
GNU make specifically. POSIX make is too minimal.
 
GNU make specifically. POSIX make is too minimal.
this is an unusually common pattern: "GNU ____ specifically. POSIX ____ is too minimal."
of course with many things in the computing world, specifications are merely nice descriptions of some of the things the most thoroughly-used implementations did

the best specification efforts use this to their advantage by watching a bunch of extensions happen and then making standards out of the very best shit
if you go the other way around you will get stuff like c++ modules
 
I've never written a graphical program. I've written the libraries I use to send ECMA-48 terminal control codes composed into various things, but that's a far cry from graphical programs. They're far too difficult to use without bringing along some giant dependency, which is half the reason assholes just use a WWW browser instead these days. I could do the research to use X11, but it shouldn't be that damn difficult. Now, there's a Common Lisp library that makes declarative interfaces with the native systems across Microsoft Windows, Mac OS X, and GNU/Linux easy, but it's part of a proprietary implementation.

I've come across Decker, and quite like it so far. This is where I wanted to upload the gif of him building a calculator in a few minutes from that page, but I can't get the attachment to go through, so here's the splash screen instead:
DpRH87.gif

Basically, it's like Hypercard, but I figure most of us have never used Hypercard. Put simply, it's an interactive environment for building programs and other little things, and it's so simple a child could be taught how to use it. I'll compare it to Uxn, but done correctly. The people who designed Uxn probably sought to reduce the arbitrary decisions they made, but copying a processor from the 1980s is still arbitrary, and uselessly so. Decker, in comparison, has Lil, which allows people to write programs normally, but also has facilities for array programming and treating data structures like databases to be queried. It's got the design hallmarks of a toy language, but it's an awfully nice toy language.

I'm pleased to say that I'm having fun using Decker. There's a little jam going on this month too in which I plan to participate. The Wigglypaint program I've seen around, which some of you may recognize, was implemented in Decker. I'm still just a casual user, but I'm thinking about how to implement the kinds of interfaces I want to see in it, and Decker's certainly powerful enough for the task. To make my nice, animated avatar I ended up just learning enough SVG to write it out in XML in GNU Emacs, and animating it with CSS was a horrible pain in the ass, as was finding a good program for rasterizing it into a gif. I'm going to try my hand at implementing a graphical program for making these little symbols in Decker soon. Nicely enough, Decker has a mechanism for outputting XML, so I can even port the knowledge I've gained over to make it even more useful.

Now, realistically, I wouldn't give a shit about any of this without the next quality: Decker has a WWW implementation, but it also has a native C language implementation using SDL2. That one quality makes it most appealing, as damn near everything else I see in this space sounds awesome until it gets to the part where it states that I just need to load up a WWW browser to use it. I've spent a while auditing the Decker source code. It's written in that horrible style array programmers writing C language code love to use, but it's tolerable, and I noticed no malice.

Now, on the topic of makefiles, I've got a question. There's a section of the Decker makefile I couldn't understand, so I edited it out when I used it:
Makefile:
ifneq ($(V),1)
    Q:=@
endif

# include potentially unsafe/nonportable scripting APIs
# FLAGS:=$(FLAGS) -DDANGER_ZONE

decker: c/build/decker
lilt: c/build/lilt

c/build/decker: c/resources.h c/decker.c c/dom.h c/lil.h
    @mkdir -p c/build
    $(Q)$(COMPILER) ./c/decker.c -o ./c/build/decker $(SDL) $(FLAGS) -DVERSION="\"$(VERSION)\""
From what I know, Q will be set to the name of the target for the invocation, but V is defined nowhere, it seems. From what I can tell, if V equals one, then Q will be empty, making it pointless, but why would it be written this way? What's the possible purpose in calling deckergcc?
 
I've come across Decker, and quite like it so far.
Decker is awesome. The language is especially cool, I've used it for data analysis before (it has SQL-like features built in the language itself).

From what I know, Q will be set to the name of the target for the invocation, but V is defined nowhere, it seems. From what I can tell, if V equals one, then Q will be empty, making it pointless, but why would it be written this way? What's the possible purpose in calling deckergcc?
@suppresses echoing the command itself, so setting V=1 makes the rule also print the command to stdout. Some don't like when their build scripts print a bunch of CFLAGS and file paths to the terminal, so they choose to disable outputting them. For debugging your Makefile or larger build system you would want to see what exact commands are being ran. In his case make V=1 would be like set -x in Bash.
 
I've never written a graphical program. I've written the libraries I use to send ECMA-48 terminal control codes composed into various things, but that's a far cry from graphical programs.
I know it's terminal only, but you might get a kick out of ncurses. It's pretty ergonomic for C IMO.
 
TFM said:
Can I use Notcurses in my closed-source program?

Notcurses is licensed under Apache2, a demonstration that I have transcended your petty world of material goods, fiat currencies, and closed sources. Implement Microsoft Bob in it. Charge rubes for it. Put it in your ballistic missiles so that you have a nice LED display of said missile's speed and projected yield; right before impact, scroll "FUCK YOU" in all the world's languages, and close it out with a smart palette fade. Carve the compiled objects onto bricks and mail them to Richard Stallman, taunting him through a bullhorn as you do so.

Amusing for a cuck license!

notcurses promotional propaganda:
 
Last edited:
btw if anyone is stuck with meson and sdl2_gfx here is the wrap file contents for it and a functioning meson.build file.

sdl_gfx.wrap
Code:
[wrap-file]
directory = SDL2_gfx-1.0.4

source_url = https://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.4.tar.gz
source_filename = SDL2_gfx-1.0.4.tar.gz
source_hash = 63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262

meson.build
Code:
project('sdl2-gfx', 'c',
  meson_version : '>=0.57.0',
)

mod = import('unstable-external_project')

p = mod.add_project('configure',
  configure_options : ['--libdir=@PREFIX@/@LIBDIR@','--prefix=@PREFIX@'],
  verbose : true,
)

sdlgfx = p.dependency('sdl2-gfx')
meson.override_dependency('sdl2-gfx', sdlgfx)

I still havent figured out how to link it into my project but I wanted to share this just incase anyone gets stuck in the same position as me.
 
@suppresses echoing the command itself, so setting V=1 makes the rule also print the command to stdout.
Ah, I knew about the @ feature, but didn't know it extended like that. I sincerely appreciate the help.
I know it's terminal only, but you might get a kick out of ncurses. It's pretty ergonomic for C IMO.
The task doesn't require using a C language library, so I avoid it. My library could even ask for the terminal dimensions without delving into ioctl and TCGETWINSIZE. Xterm and the others implement the extended colour control codes improperly, by the way, which was fun to figure out.
 
In my current project, I've made it my mission to avoid malloc and free as much as possible, as well as using more offensive programming techniques as opposed to defensive.
It's some of the best C I've written, I haven't had a single segfault or really any memory access violation. I'm using more structs of arrays as opposed to typical structs, and things are just cruising along.

My code is very easy to reason about, and because of how I'm using memory, it's very easy for me to mentally model how the resulting assembly is going to look and function. I'm incredibly pleased, I feel like I'm learning a lot. Hope you guys are having fun with your projects too.
 
My code is very easy to reason about, and because of how I'm using memory, it's very easy for me to mentally model how the resulting assembly is going to look and function. I'm incredibly pleased, I feel like I'm learning a lot. Hope you guys are having fun with your projects too.
IMO always modelling the data structures first is the way to go with anything programming related.
 
IMO always modelling the data structures first is the way to go with anything programming related.
Absolutely. All your code is written against your data structures, so they determine what code you can even write to begin with. They're also a great starting point when diving into a code base. Without fail, the most horrible code bases all have horrifically muddled data structures that do multiple unrelated things at once and have weird implicit invariants that nobody can (or does) keep track of.
 
Back
Top Bottom