<midfavila>
but you're not as bad of a person as the type who mixes literal tabs and spaces
<midfavila>
because tabs don't have fixed width across different editors riteo
<riteo>
oh god that's just *evil*
<riteo>
so?
<riteo>
that looks like a pro to me
<riteo>
I mean, you're not drawing ASCII art, you're writing code
<midfavila>
so if you write your program with tab-indent in a zoomer editor
<midfavila>
and I try to edit it in like
<midfavila>
vi
<midfavila>
it's gonna be all over the damn place
<midfavila>
doubly so if you mix tabs and spaces
<riteo>
then just resize tab to be 4 wide
ilko has joined #kisslinux
<midfavila>
not always possible
<midfavila>
how about you just set your tab to insert four spaces?
<riteo>
because that's just stupid
<riteo>
also, not always possible
<acheam>
or just use tabs and give the power to the user to decide how they want to display it
<riteo>
exactly
<midfavila>
noooooooooooooooooooooooooooo
<midfavila>
you can't just write your documents the way you want to
<riteo>
it's too late mid, two people are against your argument, you lost
<midfavila>
fuck
<testuser[m]_>
yes
<midfavila>
i do want to develop my own style later on, though
strajder has quit [Quit: leaving]
<riteo>
yeah it'd be really the cherry on top IMO
<ang>
make that three, spaces FUCKING SUCK
<jslick>
just alternate, best of both worlds. project A uses tabs, project B uses spaces
<midfavila>
the concept of functional programming is interesting
strajder has joined #kisslinux
<midfavila>
jslick I'll kill you I swear to god
<midfavila>
never say that again
<midfavila>
>:C
<jslick>
what is wrong with that?
<ang>
alternate by line, even cooler
<midfavila>
this is a holier crusade than vi vs emacs
<midfavila>
no
<midfavila>
fucking
<midfavila>
mercy
<acheam>
I do have a repo where some of my files are 2 space indent, some are 4 space indent, and some are tab indent
<midfavila>
you know who else uses tabs, acheam?
<midfavila>
drunkards
<midfavila>
are you a drunkard?
<acheam>
I present to you the greaest, most standard repo of them all:https://git.armaanb.net/bin/tree/?id=2a5674a5a26af6e74a51907d17f0401d3c8c4064
<acheam>
midfavila: yes.
<midfavila>
at least you're honest
<midfavila>
uwu
<riteo>
oh my god acheam why did you do this
<acheam>
uhh lots of editor/config hopping
<acheam>
i will go through right now and standardize it
<riteo>
will you do it by hand?
<midfavila>
i went through all my shell scripts a while back and did that
<acheam>
no
<acheam>
==
<riteo>
I'm curious, how will you fix it? Sed?
<acheam>
open them in emacs, and use the automatic indentation command
<riteo>
oh cool
<acheam>
because I use evil mode, its mapped to ==
<acheam>
its in vim too
<midfavila>
why not just like
<midfavila>
sed s/ */[tab]/g
<noocsharp>
mid: i suggest that you don't use bool as a variable name generally because it becomes a type as soon as you #include <stdbool.h>
<midfavila>
noocsharp yeah, I know it's not the best name
<jslick>
or just :retab!
strajder has quit [Client Quit]
<midfavila>
but I haven't worked with booleans themselves yet
<midfavila>
and I'm trying to stick to what K&R has introduced so far
strajder has joined #kisslinux
<midfavila>
so I figured it didn't matter.
<noocsharp>
ah ok
<midfavila>
one thing I really need to work on is drafting an idea instead of just diving right into my text editor
<midfavila>
any program/script I've ever written that was actually presentable was planned out, first
<june>
bool didn't exist in ANSI C :)
<midfavila>
oh, well, there you go
<midfavila>
there's another reason for it to not be much of a problem, haha
<riteo>
midfavilla: yeah, that's a good thing to learn
<riteo>
I mean, for small programs it's probably easier to just dive right into it and then at most refactor it later
<riteo>
you know, make it work first
<midfavila>
you would think so, but I disagree
<midfavila>
i spent like five hours tinkering on 1-18's solution without a plan
<june>
I mean I think sticking to a standard published 32 years ago is a bit silly
<midfavila>
and then spent five minutes writing a solution down, then implementing that solution in maybe half an hour
<acheam>
ansi C is just inconvinient
<midfavila>
C99 will come later.
<midfavila>
i don't intend to write GTK programs in ansi c
<midfavila>
that sounds like hell
<riteo>
wait, you aren't writing stuff in c99?
<midfavila>
no
<midfavila>
i'm sticking exclusively to what K&R has introduced
<riteo>
is it c89?
<midfavila>
so all I can work with is for/while loops, if statements, and put/getchar, as well as printf and basic variables
<midfavila>
and yes, c89 is ansi c
<noocsharp>
one of these days i'm gonna make a programming language that's literally just c without the bad stuff
<riteo>
oh
<riteo>
noocsharp: Have you looked at crowbar?
<acheam>
if you're working with for/while loops then c89 is the most inconvinient
<midfavila>
one thing that really struck me as irksome is the dismissal they had towards = and ==
<acheam>
because you cant declare the counter variable
<acheam>
within the thing
<midfavila>
meh
<midfavila>
i can see why that would be convenient, but working with convenient tools is a poor method of learning the fundaments, I think
<june>
I find C89's requirement that variables are declared at the top of a function make it hard to read
<midfavila>
hmm.
<midfavila>
i haven't found C89 difficult to read.
<midfavila>
...then again, you've probably seen my shell scripts.
<june>
when the code starts using a new variable and the declaration is already off the top of your screen and you need to scroll back up to check what type it is
* midfavila
shudders
<june>
what is the dismissal of = and ==?
<midfavila>
they mention that "sometimes novices will use = as an equality check instead of ==. the result is usually valid, so there will be no warning"
<acheam>
right
<midfavila>
that kind of bugs me about C
<midfavila>
it's tripped me up a few times
<june>
modern compilers have warnings for that
<midfavila>
clearly not
<june>
you need to turn them on
<acheam>
with -Wall -Wextra gcc/clang will warn about that stuff
<june>
using C without -Wall -Wextra is like walking blindfolded
<acheam>
^
<midfavila>
okay, well,
<acheam>
-Wall -Wextra -std=c99 -pedantic
<midfavila>
it would have been awesome if someone had told me that before
<midfavila>
because I've literally just been "cc foo.c"'ing
<testuser[m]_>
-fanalyzer can be usefull too
<acheam>
yeah... don't do that
<testuser[m]_>
useful
<midfavila>
>:VVVVVVVVVVVVVVV
<acheam>
I also don't use tcc for development
<acheam>
for the nice warnings
<june>
echo "CFLAGS += -Wall -Wextra" >Makefile && make foo
<midfavila>
there's so much shit that you're expected to know intrinsically when it comes to programming, it feels like
<acheam>
testuser[m]_: thanks, will have to play around with that
<midfavila>
just tested with -Wall, flags using void for main as an error. that's stupid.
<riteo>
wasn't it supposed to be an int?
<midfavila>
it's not *supposed* to be anything.
<riteo>
that looks like an error to me
<midfavila>
it's *suggested* that it be int,
<riteo>
how will you return the exit codes then?
<midfavila>
exit codes aren't needed in simple programs.
<testuser[m]_>
-Wall doesn't imply -Werror do you can ignorw it ?
<june>
pretty sure in C89 main is required to be declared int main
<midfavila>
well, pretty sure it's not
<midfavila>
considering I've been declaring my mains as void since the start.
<riteo>
I knew that implicit exit code returning was a """""new""""" thing
<riteo>
not something from ansi c
<midfavila>
K&R suggests it
<midfavila>
so it's not """""new"""""
<riteo>
I see
<midfavila>
but like,
<june>
yeah in C99 you don't need to return a value from main
<midfavila>
if my shitty histogram program breaks
<riteo>
gtg for a moment
<midfavila>
i don't need a return code to tell me that
<june>
it's declared int and implicitly returns 0
<midfavila>
ew.
<midfavila>
i don't like that.
<june>
and yet you don't want to return anything from main!
<midfavila>
right, I don't. which is why it's declared void.
<midfavila>
if *I* was in charge of things, main wouldn't return anything if not explicitly stated.
<midfavila>
main() would be equivalent to void main()
<midfavila>
not int main()
soliwilos has quit [Quit: nyaa~]
<june>
well that's just not how it is
<midfavila>
doesn't change my opinion on it. = w=
soliwilos has joined #kisslinux
<june>
there is runtime code that calls your main function, and that runtime code needs an exit status to use when your function returns
<midfavila>
why does it need an exit code?
<midfavila>
more importantly, what changed from 89 to 99 that warranted that?
<midfavila>
legit questions
<june>
because that's how processes work
<midfavila>
...I mean.
<midfavila>
...my programs run just fine without using return at all.
<testuser[m]_>
echo $?
<june>
yes and their exit code (in C89) is undefined
<midfavila>
so long as nothing is depending on that, who cares?
<june>
yeah C89 says there are only two ways to declare main:
<june>
int main(void) { /*...*/ }
<june>
int main(int argc, char *argv[]) { /*...*/ }
<riteo>
here I am
<midfavila>
K&R doesn't say anything of the sort.
<acheam>
semi-related question
<june>
K&R is not a language specification
<acheam>
if I need argv, but not argc, how can I do that without a compiler warning
<midfavila>
right, but I'm not implementing a compiler.
<acheam>
because if I use argc,argv in the main declaration, I don't use argc
<acheam>
do I just cast it to void or something?
<june>
(void)argc;
<acheam>
hm thanks
<june>
is the usual idiom for marking unused parameters
<acheam>
oh heres another style question
<acheam>
when do I put space between the cast type and the thing to be casted
<acheam>
I usually put a space between malloc and (type), but not between (type) and variable
<june>
this is similar to where does the * go
<acheam>
hmm so always to the right?
<june>
(type) is a high-precedence right-to-left associativity operator
<acheam>
still, it feels weird to write:
<acheam>
(char *)malloc(10)
<acheam>
but maybe thats just me
<june>
so it's the same as a ! for example. you'd write !foo, so you'd write (int)foo
<june>
at least that's the justification. write how you want :)
<acheam>
thanks!
<june>
the place I make an exception for this, because it's not really the same imo, is in compound literals
<acheam>
a what now
<june>
(struct Foo) { 1, 2, 3 } looks much nicer than (struct Foo){ 1, 2, 3 }
<june>
C89 is harder to find a good copy of than more recent standards
<acheam>
there is quite an irony of linking to http link from port70.net
<acheam>
same as the logs in our topic lol
<noocsharp>
riteo: crowbar looks interesting, but i think i would want something simpler
<midfavila>
scheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeme
<midfavila>
i mean, or wisp. wisp is even simpler than scheme, at the cost of syntactically significant whitespace
<june>
midfavila: you say nothing depends on it, but are you really never going to run your program with && after it? ever? for sure?
<midfavila>
yes, june, positive
<midfavila>
as it stands my programs are not intended to be scriptable. they are simple enough that if you wanted to script them, you can modify them for your own needs
<riteo>
noocsharp I see
<midfavila>
when I write programs that *are* intended to be scripted, I will return exit codes, because at such a time they're actually going to be useful
<riteo>
noocsharp: maybe I got another "simpler C" kind of project for you. What would you use it for?
<june>
you've definitely spent more time typing into IRC about this than it would've taken to replace void with int and add return 0; though
<midfavila>
yup, I have. because I don't particularly need my main to return an int.
<midfavila>
until such time I do, I will continue to cast main as void.
* midfavila
shrugs
<june>
and your programs will continue to be incorrect
<june>
something to be said about habit development, I think
<midfavila>
the compiler seems pretty happy with my programs.
<june>
like oh I don't *need* to check if this function call succeeds, this is just a toy program. so you don't develop the habit of error checking
<noocsharp>
riteo: i would mostly want to make the language to learn how to build a compiler, and maybe use it for other esoteric projects
<riteo>
mhh
<midfavila>
june it's a matter of "It's unneeded in this instance."
<riteo>
noocsharp do you know that devault is making a system language aimed at that? Maybe you could take a peek at it, altought it hasn't released yet
<june>
here's the thing about C compilers: they're pretty much happy to compile a literal turd
<midfavila>
cool.
<noocsharp>
riteo: ive seen it, looks interesting, but the main reason i would make my own language is to learn how compilers work
<riteo>
oh, I see
<riteo>
so you want to make more of a toy language?
<midfavila>
write a POSIX shell compiler
<noocsharp>
probably, maybe if it gets good enough, actually use it for things
<midfavila>
maximum cursedness.
<noocsharp>
midfavila: i an not that much of a masochist
<midfavila>
make a POSIX shell compiler in POSIX shell
<riteo>
noocsharp: cool idea
kqz has quit [Read error: Connection reset by peer]
testuser[m]_ has quit [Quit: testuser[m]_]
testuser[m]_ has joined #kisslinux
riteo has quit [Quit: epic messed up date for testing moment]
riteo has joined #kisslinux
illiliti has joined #kisslinux
mahmutov has joined #kisslinux
cy6x has joined #kisslinux
<cy6x>
@testuser, hi again :). I reinstalled gkiss just in case, but this time i took into account everything you told me: "ln -s /etc/sv/seatd /var/service" and "echo -e '#!/bin/sh\n\n/bin/modprobe nvidia-drm modeset=1' > /etc/rc.d/modules.boot". The strange error that appeared last time remains. I want to debug the program, but I still don't understand how to do it. Could you please explain how to do this for
<cy6x>
a beginner (with the commands)?
kqz has joined #kisslinux
<testuser[m]_>
before building anything with debug symbols, try plain "ulimit -c unlimited" and see if the trace says anything uswful
<testuser[m]_>
(ulimit -c unlimited; sway --args)
<cy6x>
ok, i'll try
strajder has quit [Quit: leaving]
strajder has joined #kisslinux
cy6x has quit [Quit: Lost terminal]
cy6x has joined #kisslinux
<cy6x>
there is no difference with or without using the command in the output
<cy6x>
the output is the same
Guest12 has joined #kisslinux
Guest12 has left #kisslinux [#kisslinux]
<cy6x>
hmm
<acheam>
ugh writing documentation is the worst, I can see why so many projects just don't do it
<riteo>
acheam: just think all the times when you couldn't do something due to missing documentation and how much you/anybody using your program will be frustrated
<riteo>
you'll write it in flash
<midfavila>
ngl I've always looked forward to writing docs for stuff I write
<midfavila>
it's my own little opportunity to gush about what I've done.
<midfavila>
now,
<midfavila>
writing docs for *other* projects? *that* would be a pain
<midfavila>
because then you have to pore over the source code and figure out what everything does.
<riteo>
I mean, if you really care for that piece of software why not?
soliwilos has quit [Quit: nyaa~]
<midfavila>
oh, if you already care for it, then it's whatever. you're used to staring at the source all day and probably know it in and out
soliwilos has joined #kisslinux
<midfavila>
but if you've got a super-complex program that you've never read before, well...
<midfavila>
let's just say I don't envy anyone who writes docs for Mesa, LLVM or GCC
honeyedbee has joined #kisslinux
<riteo>
I see
<riteo>
yeah I agree
<testuser[m]_>
cy6x: running ulimit -c unlimited before running the cmd should always show a trace on segfault
<kernelc>
AFAIK it was created for use with oasislinux, which has its own build system, so Makefiles and build instructions are missing
<cem>
kernelc: My main suggestion would be just asking mcf on IRC, but oasis' build files also show exactly what needs to be compiled and linked together
<cem>
It's kind of cryptic for the first time you are looking at oasis' build system, but you get easily used to it