Hi,
alexfru wrote:The assembler won’t detect many similar errors either.
Undefined behavior is bad, but, sorry, you must know the tool (the language) that you’re using.
The problem with C is that someone who has a very good understanding of the language and years of experience still gets caught by subtle stupidities that could've/should've been prevented by better language design.
alexfru wrote:CPU instructions too have unspecified behavior (e.g. see what the docs say on large shift counts).
Assembly isn't a high level language; and that unspecified behaviour only ever involves irrelevant corner cases that nobody cares about (and doesn't involve things programmers frequently use or things programmers frequently get caught by).
alexfru wrote:There’s no de-facto assembler standard, while there is for C.
Why do you think I care? My intent is to develop my own language and tools (and use assembly until such time as I can port my stuff to my own language); mostly because C is unsuitable.
alexfru wrote:There’s no standard assembler library either, which is infinitely less than the minimalist standard C library.
Why do you think I care? My intent is to develop my own language and tools (and use assembly until such time as I can port my stuff to my own language); mostly because C is unsuitable.
alexfru wrote:Non-trivial software in assembly is much less trivial to develop, maintain and support than the same non-trivial software in C. This is why people moved to C when the time was right.
Why do you think I care? My intent is to develop my own language and tools (and use assembly until such time as I can port my stuff to my own language); mostly because C is unsuitable.
alexfru wrote:Don’t exaggerate or omit important details, #if(def) isn’t only used to make zero-cost if(). It is also used to include code that would only compile for this target or exclude code that would not compile for this target. If C were an interpreted language, unreachable code could reside under if() just fine, but C must syntactically and otherwise check all code that is subject for compilation.
Your "
also used to include code that would only compile for this target or exclude code that would not compile for this target" is exactly what I meant by "
allow programmers to work around "hard to make non-trivial software portable" problems". It was explicitly mentioned and definitely not omitted at all.
alexfru wrote:Plain text assembly isn’t better than plain text C. Too many minute details, too many lines for simple things.
Why do you think I care? My intent is to develop my own language and tools (including IDE); mostly because C and plain text is unsuitable.
alexfru wrote:You can argue about assembly code formatting just as well as about C code formatting.
Why do you think I care? My intent is to develop my own language and tools (including IDE); mostly because C and plain text is unsuitable.
alexfru wrote:I don’t see how bad object files are better in assembly world than they are in C world. Does your linker perform link-time optimization of the code that was written in assembly? Does your assembler/linker reuse previous work?
Why do you think I care? My intent is to develop my own language and tools (including IDE); which won't have any linker and will reuse previous work.
alexfru wrote:Optimizing for a specific CPU or not is debatable. One wants things just to work out of the box. Another wants best performance and is OK with recompiling the code manually or waiting for some tool to recompile it automatically. You can’t make everyone happy with just one solution. So, often times you end up with someone unhappy (either the guy for whom things don’t work out of the box or the guy who doesn’t get the max performance out of the box or the poor guy that tries to please everyone and create a bunch of binaries to suite everyone else).
Are you serious? The idea is at least 50 years old; dating back to Pascal's "
P-code" if not before; Java has been doing "executable delivered as byte-code and compiled for specific CPU at run-time" for about a decade. It was one of the goals of both LLVM and Microsoft's .Net.
alexfru wrote:I’m sorry, but I expected a bit more balanced response. Yours looks to me like bashing C and the environment/tools, while failing to note where assembly programming has the exact same problems and sometimes much worse ones.
No; you've completely ignored what I'm saying. It's not about "assembly vs. C", it's entirely "C vs. the language and tools I'm planning" (where assembly is just easier to port to those new tools).
Cheers,
Brendan