|
gently caress itcode:
|
# ? Jun 12, 2015 16:54 |
|
|
# ? Jun 10, 2024 23:38 |
|
Blotto Skorzany posted:not ub but pretend i spammed gandalf.c in here again in all its glory i couldnt get it to compile, do i need some weird flags? $ curl http://www.ioccc.org/1996/gandalf.c | clang -x c - <snip> 4 warnings and 5 errors generated. e: oh theres a makefile too e2: welp $ make gandalf <snip> 2 warnings and 5 errors generated. make: *** [gandalf] Error 1
|
# ? Jun 12, 2015 17:00 |
|
What's it do
|
# ? Jun 12, 2015 17:01 |
|
Snapchat A Titty posted:i couldnt get it to compile, do i need some weird flags? probably you need a circa 1995 c compiler, i don't think anything today will tolerate some of the preprocessor abuse that early ioccc entries tended to lean on
|
# ? Jun 12, 2015 18:10 |
|
Bloody posted:What's it do displays the ascii and ansi character tables
|
# ? Jun 12, 2015 18:12 |
|
Shaggar posted:yes its an example of dynamic typing. I want to hear the shaggar explanation for why dynamically dispatching on one object is good but multiple objects is bad
|
# ? Jun 12, 2015 19:05 |
|
anybody here used vaadin? is it any good?
|
# ? Jun 12, 2015 19:19 |
|
Athas posted:Why do people fetishize C to this degree? It is just a programming language. It is not particularly unsafe - it is even stronly typed! It is not some exotic, dangerous thing, it is one of the most mainstream and widely used languages you can get. C is not strongly typed in any meaningful way. in fact, C is the prototype example of a weakly typed language. there are implicit type conversions all over the place, and unsafe casting is the norm. a type in C is really just a way to tell the compiler how much memory it needs to allocate, and that's about it
|
# ? Jun 12, 2015 19:27 |
|
JewKiller 3000 posted:C is not strongly typed in any meaningful way. in fact, C is the prototype example of a weakly typed language. there are implicit type conversions all over the place, and unsafe casting is the norm. a type in C is really just a way to tell the compiler how much memory it needs to allocate, and that's about it I've had arguments during interviews about if C is weak or not. I got hired but I still disagreed with someone saying it's strongly typed.
|
# ? Jun 12, 2015 19:45 |
|
Space Whale posted:I've had arguments during interviews about if C is weak or not. strongly typed* *can ignore all typing if wanted
|
# ? Jun 12, 2015 19:48 |
|
Sweeper posted:strongly typed* c has types? I thought you just had to write int or *int or sometimes even **int next to everything so that intered the variable into the runtime.
|
# ? Jun 12, 2015 19:52 |
|
gonadic io posted:c has types? I thought you just had to write int or *int or sometimes even **int next to everything so that intered the variable into the runtime. i guess you could call them type suggestions?
|
# ? Jun 12, 2015 19:55 |
|
Sweeper posted:i guess you could call them type suggestions? a "light hint" or "lint"
|
# ? Jun 12, 2015 19:57 |
|
types in c are basically just a way to give names to particular offsets from a pointer
|
# ? Jun 12, 2015 19:57 |
|
Shaggar posted:use c# and java and embrace the corporate culture of not caring at all and getting the gently caress out at 5. first shaggar post i've ever agreed with
|
# ? Jun 12, 2015 20:00 |
|
JewKiller 3000 posted:a type in C is really just a way to tell the compiler how much memory it needs to allocate, and that's about it the most infuriating bug i ever fixed was caused by an rtos that basically did code:
this turned this typo code:
so C has a type system that is actually useful, but you can turn off the useful parts, and you can do so in headers to really gently caress with people.
|
# ? Jun 12, 2015 20:02 |
|
To be fair if you're really determined you can circumvent any type system. Unsafe blocks, haskell's unsafeCoerce, gently caress even agda has a "make this type check" compiler directive iirc
|
# ? Jun 12, 2015 20:36 |
|
types are a fake idea
|
# ? Jun 12, 2015 20:38 |
|
Tiny Bug Child posted:types are a fake idea types are just as fake as anything else in most programming languages: an abstraction the compiler understands that you use to help you write code more easily if you want non-fake programming write asm, but even thats an abstraction these days lol
|
# ? Jun 12, 2015 20:46 |
|
the idea that types help you write code more easily is a fake idea
|
# ? Jun 12, 2015 20:49 |
|
why is Twisted so bad
|
# ? Jun 12, 2015 20:51 |
|
Tiny Bug Child posted:the idea that types help you write code more easily is a fake idea the idea that automatic type coercion helps you write code more easily is a fake idea see, i can do it too
|
# ? Jun 12, 2015 20:51 |
|
Tiny Bug Child posted:the idea that types help you write code more easily is a fake idea you can say this, but it's wrong Tiny Bug Child posted:types are a fake idea you can't say this, though. types are absolutely fundamental to computation. truly untyped data is useless: a raw stream of bytes that is completely opaque to you
|
# ? Jun 12, 2015 20:56 |
|
Dessert Rose posted:types in c are basically just a way to give names to particular offsets from a pointer also give names to groups of such offsets together so c has objects, composition and no inheritance which is actually pretty good OOP-wise
|
# ? Jun 12, 2015 21:10 |
|
Blotto Skorzany posted:the most infuriating bug i ever fixed was caused by an rtos that basically did what is even the idea behind that? like are they trying to expose an opaque type except they dont have brains in their heads?
|
# ? Jun 12, 2015 21:36 |
|
it would not be the first example of somebody not realizing that you can just leave something forward-declared the sort of idiot who does that is also the sort of idiot who would use a macro instead of a typedef for no goddamn reason
|
# ? Jun 12, 2015 21:45 |
|
Paper about FB's software verification stuff: https://research.facebook.com/publications/422671501231772/moving-fast-with-software-verification/ We released the tool yesterday as well: http://fbinfer.com
|
# ? Jun 12, 2015 21:45 |
|
Snapchat A Titty posted:what is even the idea behind that? like are they trying to expose an opaque type except they dont have brains in their heads? rjmccall posted:it would not be the first example of somebody not realizing that you can just leave something forward-declared pretty much, yep. i think it got "fixed" in a later release of the rtos tbh even if they had implemented opaque types properly i don't think that sort of information hiding is justified in the context of a small rtos for use with micros - i need to be able to see the guts of things and it would be nice if the fields showed up properly in the debugger. eg. I can understand why you'd want to have an opaque type for a task in most code, but when i've got mpu exceptions getting thrown that i'm trying to figure out i'd like to be able to inspect the tcb to see whether the stack pointer has been trashed. especially since, in that rtos, the task stack grows towards the tcb and thus an overflow tends to trash it
|
# ? Jun 12, 2015 22:20 |
|
JewKiller 3000 posted:C is not strongly typed in any meaningful way. in fact, C is the prototype example of a weakly typed language. there are implicit type conversions all over the place, and unsafe casting is the norm. a type in C is really just a way to tell the compiler how much memory it needs to allocate, and that's about it There are not many implicit type conversions in C. It is strongly typed but with many ways to cheat the system. That just makes it unsound, not weak.
|
# ? Jun 12, 2015 23:39 |
|
Subjunctive posted:Paper about FB's software verification stuff: https://research.facebook.com/publications/422671501231772/moving-fast-with-software-verification/ i love me some static analyzers
|
# ? Jun 13, 2015 00:21 |
|
Athas posted:There are not many implicit type conversions in C. It is strongly typed but with many ways to cheat the system. That just makes it unsound, not weak. please give your definition for strongly typed, tia
|
# ? Jun 13, 2015 00:22 |
|
Athas posted:There are not many implicit type conversions in C. float/int implicitly converts, any pointer type implicitly converts to/from void*, int and int* implicitly convert (although most compilers issue a warning for this), enums and ints implicitly convert, several integer types implicitly convert under certain circumstances, that seems like a lot of conversions without explicit casts to me
|
# ? Jun 13, 2015 01:29 |
|
"strongly typed" is a propaganda term, it means whatever you want it to mean one definition is soundness, where a type system is sound if a well-typed program is guaranteed to run without type errors. but then you have to define "type error", which is tricky — is a bad downcast in java a type error or just part of the program semantics? is it different if it's implicitly inserted by the language as part of (say) calling get(10) on a List<String>? sometimes people say it's about implicit conversions, but then it turns out that their private definition of "conversion" excludes some things that seem okay to them, like integer promotions and class upcasts, which i think is just an informal approximation of soundness. except that most languages/libraries have explicit, asserting conversions which impact soundness just as much as implicit ones; but maybe unsoundness is okay if it's explicit? or maybe it's all implicit conversions, even the sound ones, which is fine and very specific definition except the term is always thrown about as if it has strong moral value and i don't see the connection when it's divorced from soundness really i think that we just have to accept that — unless we are theorem proving — the interesting property is a very slippery judgement about the risk of deviation from the program's intent. and with that definition in hand, we can readily say that c has many features that increase that risk a lot for ordinary programs, and that c++ eliminates some of those sources of risk but by no means all, and that other type systems eliminate many more
|
# ? Jun 13, 2015 02:40 |
|
Tiny Bug Child posted:the idea that types help you write code more easily is a fake idea i wish your posts were untyped!!
|
# ? Jun 13, 2015 04:27 |
MALE SHOEGAZE posted:i wish your posts were untyped!! NICE!
|
|
# ? Jun 13, 2015 05:17 |
|
C's weak typing isn't that bad if you enable a shitton of warnings without them I'm pretty sure C programming would be absolute nightmare
|
# ? Jun 13, 2015 06:05 |
|
did we agree MUMPS is the worst yet?? thanks
|
# ? Jun 13, 2015 06:14 |
|
detroit posted:did we agree MUMPS is the worst yet?? thanks fire up the dentist signal
|
# ? Jun 13, 2015 06:34 |
|
the "distinction" between strong and weak typing is nowhere near as important as the distinction between static and dynamic typing (the latter is not typing). and as other posters have explained, strong/weak typing are not very well defined, so such terms are avoided in the literature. but when it does appear, the term "weak typing" applies invariably to C or maybe PHP, but PHP is not a programming language. it's a set of functions that you can call, but should not
|
# ? Jun 13, 2015 06:58 |
|
|
# ? Jun 10, 2024 23:38 |
|
it's been said that php is just a wrapper around a bunch of c functions and that's kind of true. in a way, it's c for the modern era of the web. it's easier to work with and all the useless stuff like pointers is stripped out
|
# ? Jun 13, 2015 07:13 |