Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Ciaphas posted:

Alright, what's a non terrible build system? cmake?

Assume I know precisely gently caress and All about anything besides makefiles, which is pretty much the case

trick question they're all terrible

Adbot
ADBOT LOVES YOU

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Guess I'll start with cmake then, i'm sure i'll be back with questions

I suppose my first one is why Makefiles are supposedly terrible, one of our other projects uses them and works just fine, just gotta add source files to the appropriate section. Though it's only compiling one executable, not multiple, so I guess that's a factor

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Plorkyeran posted:

trick question they're all terrible

well this is the right thread for it then!!!!!!!!!!!!

Bloody
Mar 3, 2013

it sucks that c# list<T>'s ToArray performs a copy. i know its got an array backing it, just gimme a reference to that directly somehow please

had to refactor a buncha stuff to use array[]s instead of Lists because of this today and well it performs a lot better thanks to way less random poo poo gettin copied around but its also ugly

Mao Zedong Thot
Oct 16, 2008


cmake is markedly worse than make

terrible programmers don't like make because it's one of those tools you have to *learn* how to *use* (also it's p easy to shoot yourself in the foot with a make abomination, but what is that not true of?)

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


VOTE YES ON 69 posted:

cmake is markedly worse than make

terrible programmers don't like make because it's one of those tools you have to *learn* how to *use* (also it's p easy to shoot yourself in the foot with a make abomination, but what is that not true of?)

well now i'm just confused and annoyed :mad:

Bloody
Mar 3, 2013

maven is the only good build tool

Xarn
Jun 26, 2015

Plorkyeran posted:

trick question they're all terrible

Xarn
Jun 26, 2015
c tp s: I know basically nothing about macros, but I want a macro that expands into a bunch of conditional preprocessor logic and directives. Possible, Y/N? (I know it's not sane :v:)

Bloody
Mar 3, 2013

what language? c?

tef
May 30, 2004

-> some l-system crap ->

eschaton posted:

sounds like a challenge to me

https://brandur.org/postgres-queues

so this talks about some of the problems you'll have if you did it in postgres

although it might apply to any mvcc system that stores multiple versions (rather than say undo records)

so yeah if you're looking for a challenge you'll need to start on 9.6 by default

you're going to need use a partitoned table, and this ain't totally automatic yet so you don't take out autovacuum for deleting jobs

collecting subtables is going to be fun, but you could tie it to re-delivery of jobs that failed, but you're going to need some sort of epoch/worker leases

i thnk a brin index might help too when you're scanning over the subtables working out where the next job is too

open a transaction, find the job entry and delete it/update it without commiting (or select for update), and use SKIP LOCKED when scanning for a new job

on the other hand, this might be a bad idea if you have to have a lot of transactions open

it might be easier to scan another table, flush into a UNLOGGED table, workers enqueue by deleting the first entry they find, but you'll still need to do the partitioning bollocks

and yeah so then your worker will need some way to automate and hand out the work, like using a table lock over the partitioned tables

but honestly it's always going to be a terrible fit because a b-tree is the wrong sort of index for this

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

Xarn posted:

c tp s: I know basically nothing about macros, but I want a macro that expands into a bunch of conditional preprocessor logic and directives. Possible, Y/N? (I know it's not sane :v:)

yes of course. what's your lisp dialect of choice?

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

ynohtna posted:

yes of course. what's your lisp dialect of choice?

ZetaLisp

no, Common Lisp

no, FUTURE-COMMON-LISP

aieeeeee

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Bloody posted:

it sucks that c# list<T>'s ToArray performs a copy. i know its got an array backing it, just gimme a reference to that directly somehow please

had to refactor a buncha stuff to use array[]s instead of Lists because of this today and well it performs a lot better thanks to way less random poo poo gettin copied around but its also ugly

needing to call .ToArray on a List in the first place is weird.

I'm assuming it was third party code that demanded an array? if not, refactor that to take an IEnumerable / IList / IReadOnlyList

e: if you do need to work a lot with plain old arrays, extension methods are their best friends

NihilCredo fucked around with this message at 23:24 on Jan 10, 2017

raminasi
Jan 25, 2005

a last drink with no ice

Bloody posted:

it sucks that c# list<T>'s ToArray performs a copy. i know its got an array backing it, just gimme a reference to that directly somehow please

had to refactor a buncha stuff to use array[]s instead of Lists because of this today and well it performs a lot better thanks to way less random poo poo gettin copied around but its also ugly

ew no they should not just vomit out access to their backing store on demand, that'd be terrible. why do you even want to do that?

jesus WEP
Oct 17, 2004


Bloody posted:

maven is the only good build tool

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


is maven something that'll be on a basically-stock RHEL install because i have cmake but dunno about maven, i'll have to go back and check tomorrow

before i left i got cmake to put together a program consisting of a single src/ and include/ directory but i'm a bit confused on how to do it when there's multiple modules/directories

i.e. where A and B need to compile to make my final program, and A needs modules A1 and A2 to compile, etc.
pre:
A
|-A1
|-A2
B
|-B1
|-B2
|-B3

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Ciaphas posted:

Guess I'll start with cmake then, i'm sure i'll be back with questions

I suppose my first one is why Makefiles are supposedly terrible, one of our other projects uses them and works just fine, just gotta add source files to the appropriate section. Though it's only compiling one executable, not multiple, so I guess that's a factor

make is a basically good idea (a build system is a dependency graph plus a set of commands to produce each file given its dependencies). it has some relatively superficial problems that frustrate a lot of people (make the language that you specify your dependency graph with is a bad language with bad syntax), but it also has some deeper problems.

it fundamentally doesn't support having a build command which produces multiple output files.

it's very easy to have a makefile which will occasionally fail when built on a 12-core machine but always work on a 4-core machine because you're missing a single edge somewhere in your dependency graph.

it doesn't handle dynamic dependency graphs. normally you don't explicitly specify header dependencies for source files and instead have your compiler emit a makefile that specifies them based on which files it included. this breaks when you have things like generated headers: when you first add a new generated header the source file won't already depend on it, so there's nothing that'll make make decide to build the header before the source file, and you have to run the build twice.

it composes poorly. calling itself recursively on subdirectories is basically the only way to import an independent make build system into your build system, and while that's very elegant in a sense we figured out that it was fundamentally broken and a bad idea a few decades ago.

it scales poorly. (some) modern build tools are dramatically faster for large projects.

i feel i should repeat again that make-the-language is very bad. a large chunk of what automake does are things which can be done in plain make, but is awful because make-the-language is bad.

jesus WEP
Oct 17, 2004


Ciaphas posted:

is maven something that'll be on a basically-stock RHEL install because i have cmake but dunno about maven, i'll have to go back and check tomorrow

before i left i got cmake to put together a program consisting of a single src/ and include/ directory but i'm a bit confused on how to do it when there's multiple modules/directories

i.e. where A and B need to compile to make my final program, and A needs modules A1 and A2 to compile, etc.
pre:
A
|-A1
|-A2
B
|-B1
|-B2
|-B3

maven is java specific

Bloody
Mar 3, 2013

NihilCredo posted:

needing to call .ToArray on a List in the first place is weird.

I'm assuming it was third party code that demanded an array? if not, refactor that to take an IEnumerable / IList / IReadOnlyList

e: if you do need to work a lot with plain old arrays, extension methods are their best friends

ya its some of the uglier parts of the .net api

Bloody
Mar 3, 2013

raminasi posted:

ew no they should not just vomit out access to their backing store on demand, that'd be terrible. why do you even want to do that?

std::vector can do it!!!

Bloody
Mar 3, 2013

I'm not sayin itd be a good thing its just annoying that one dumb but necessary library function that only takes arrays has infected much of my code with arrays where I used to be using ienumerables and lists

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Pie Colony posted:

what's wrong with that? i've used file system based queues before and they worked alright. atomic mv and all that

nothing except the part where a windows service serializes and deserializes into some roll-your-own format and oh by the way the settings are managed through a web app but the settings are only read on service start. if you changed settings while the service was running the service would overwrite the files thereby clobbering your changes because oh yeah the settings are stored in the files, too. on top of all that the job types are organized in the very shittiest of inheritance hierarchies so LOL if you want to change or extend anything.

Shaggar
Apr 26, 2006

Bloody posted:

maven is the only good build tool

Plank Walker
Aug 11, 2005

Bloody posted:

i gently caress up whiteboard interviews like this all the drat time. i get up there and completely forget what the hell the * actually does and stuff. its awful

try just using an indecipherable scribble












for every character

worked for me

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

raminasi posted:

ew no they should not just vomit out access to their backing store on demand, that'd be terrible. why do you even want to do that?

they should return a transparently copying array so that if the backing store changes, only then does the array that was handed out turn into a copy

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Plorkyeran posted:

it scales poorly. (some) modern build tools are dramatically faster for large projects.

anyone interested in building software should watch A New Architecture for Building Software from the most recent LLVM dev meeting:

quote:

Clang was written in part to deliver fast compile times for C & C++ code. However, the traditional way C compilers integrate with build systems places many limitations on how efficiently that can be done. This talk introduces llbuild -- a new framework for building build systems -- which was designed to help solve this problem, and envisions a new architecture for compiling software which would allow us to significantly improve compilation times for large software projects.

and then of course send me any comments you have to pass along to Daniel, or just email him directly if you want

eschaton fucked around with this message at 06:41 on Jan 11, 2017

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

eschaton posted:

they should return a transparently copying array so that if the backing store changes, only then does the array that was handed out turn into a copy

What you're describing isn't an array, it's a List. If he was able to pass a List around he wouldn't have this problem in the first place.

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

eschaton posted:

This talk introduces llbuild -- a new framework for building build systems

yo dawg

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

St Evan Echoes posted:

maven is java specific

nope https://github.com/maven-nar/nar-maven-plugin

Xarn
Jun 26, 2015

Bloody posted:

what language? c?

Yeah. (C++ actually and it needs to work with whatever bugs MSVC has :v:)


The desired result is that instead of having something like this
C++ code:
#ifdef DONT_POOP
#  define NO_POOP
#endif
#include "butt.h"
#ifdef DONT_POOP
#  undef NO_POOP
#endif
there would be defined INCLUDE_BUTT macro and it would expand into this. There is more guards and I could just leave the guards around the include, but I'd prefer to have them all in one place.

ynohtna posted:

yes of course. what's your lisp dialect of choice?

I was trying to think up a "C preprocessor is the lispiest dialect" joke, but I got nothing.

Xarn fucked around with this message at 09:55 on Jan 11, 2017

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
first, use your language's metaprogramming to bootstrap a lisp

then use that lisp to make a better lisp, with macros and objects

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

https://github.com/eudoxia0/cmacro

Sapozhnik
Jan 2, 2005

Nap Ghost
Lisp was the first plang

The Leck
Feb 27, 2001

Finster Dexter posted:

lol lovely co-worker quit today... not even 2 weeks notice so I'm stuck on the team until they get a backfill trained on all the poo poo that was this guy's pet projects that he aggressively defended from any and all collaboration. haha fml :v:
as someone who's been in this situation for ~6 months or so now, you have my deepest sympathies. maybe they'll take this as a sign that more than one person should know something about this code. maybe?

Sweevo
Nov 8, 2007

i sometimes throw cables away

i mean straight into the bin without spending 10+ years in the box of might-come-in-handy-someday first

im a fucking monster

Sapozhnik posted:

Lisp was the first plang

i dunno, plangs are very occasionally used to write something useful

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
I could use feces to paint a beautiful picture but it will still smell like poo poo.

Bloody
Mar 3, 2013

regarding stupid idiot access to the array backing a list, you can definitely do some inappropriate bullshit with:
code:
[StructLayout(LayoutKind.Explicit)]
internal struct Hello
{
    [FieldOffset(0)]
    internal List<int> list;
    [FieldOffset(0)]
    internal int[] array;
}

raminasi
Jan 25, 2005

a last drink with no ice

Bloody posted:

regarding stupid idiot access to the array backing a list, you can definitely do some inappropriate bullshit with:
code:
[StructLayout(LayoutKind.Explicit)]
internal struct Hello
{
    [FieldOffset(0)]
    internal List<int> list;
    [FieldOffset(0)]
    internal int[] array;
}

uh those are both reference types

Adbot
ADBOT LOVES YOU

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


think I'm getting a better handle on cmake, and i like how (once I worked out the syntax) it lets me easily do that project split by module/library thing for unit testing purposes

problem is it's made me realize how coupled my code is already, like i have libraries A and B and A has libraries A1 and A2 but both depend on at least including B's .h files

I guess to unit test A1 and A2 i'd have to write stubs for B in the unit test program? Is that right? i've only put together single makefile monolithic builds before and haven't ever really been responsible for formal testing

  • Locked thread