flat assembler
Message board for the users of flat assembler.

Index > Heap > hll vs fasm

Goto page Previous  1, 2, 3, 4, 5, 6  Next
Author
Thread Post new topic Reply to topic
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
edfed wrote:

the only reason i see for the use of Clike HLL is their adoption by the internationnal community.


You've never felt that you wanted a type system for A) automating basic error checking or B) overloading functions based on parameter types? Personally I'd prefer to have both because A) means easier to track down errors and B) less typing.
Post 26 Aug 2013, 09:14
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
standard is like the good old times. everybody is used to it, then, everybody continue to use it.

but of course, standard can evolve, but asking evolution of standard is like asking to switzerland to write an ISO and impose it to the world.

then, maybe we can stop asking for standards, and just limit oursleve to use well known tricks.

in fact, if we consider the SSSO principle implemented in fasm, it is enough to implement any idea like we want, regardless the standards, just respect the fasm syntax and your code will work anywhere.

then, just declare your macros somewhere, let the coder access the source files to understand what they do, and the hll vs fasm problem is solved. fasm win.

but it is not as easy, the standard adoption by the community makes pretty difficult to propose alternative and more efficient solutions... maybe we should wait one or two nuclear wars to get a sort of freedom like this in handcrafted code (and materials).
Post 26 Aug 2013, 09:24
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
nyrtzi wrote:
edfed wrote:

nyrtzi wrote:

cost effectiveness and the availability of resources.

really, these parameters don't depend on the langage, and the use of Clike over assembly is not linked directlly to the cost of resources availability.


Were you even trying to understand what I was saying?
The sentences following the one you quoted explained what I was referring to with cost effectiveness and resources.
I don't believe any sane person would argue that it is better to do a big software project with assembly than for example with Java.
Would you have understood better if I had said human resources instead of just resources?


i understood, but i wanted to spot the detail about what resource is the problem. the problem is not the tool, but the human behind the scene.

then, you're true to tell the "Human" Resource is the problem.

maybe it's time to let ask the machines what is better for them.

the question can something like:
Code:
asm = cpumonitor fasm test.asm test.bin
hll = cpumonitor gcc test.c (and whatever flags gcc needs to work without error)
result  = asm - hll
if result>0 
return asm
else
return hll
endif
    

this is a pseudo shell script that will just mesure and compare the compilation processes by cpu resources (and maybe the power needed by the command), and return the faster/better/smaller/etc from a machine point of view.

the better, if we think about the current fashion, is the less power consummer process, cause it is better for the planet to use less energy to do a job.

i think the question is superfluous cause we still know the result
Post 26 Aug 2013, 09:39
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
edfed wrote:

but of course, standard can evolve, but asking evolution of standard is like asking to switzerland to write an ISO and impose it to the world.


Don't use C/C++/Java, then.
They are defined by formal specifications which are handled by institutions (C/C++: ISO, Java: JCP).
Post 26 Aug 2013, 09:45
View user's profile Send private message Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
edfed wrote:

like always, hll takes all the money.. but why?


What is a HLL? IMHO the whole term is relative to what you intend to do. And to be practical about all of this we shouldn't consider the language and the libraries as separate entities.

How high level a description of a solution to a programming (or any other) problem is determined by how exact and succint it is. The thing that makes a description low level is therefore the opposite i.e. how much the description is cluttered and obfuscated by irrelevant details. You can measure this by looking at the ratio between amount of code between the code talking about the actual problem and the code working around language and library limitations and constraints. This allows measuring of the level of the starting point when picking the language and the libraries.

The other question is that of extending and customizing the language and the libraries i.e. can you raise the level of the combination so that it would be more ideal (i.e.more higher leve) for describing your solution. With a proper macro system for example you can take out repetition from your code allowing it to become more higher level. You can do the same thing with functions and other constructs. If your language isn't powerful enough to let you take out some things through abstration but instead forces you to copy paste stuff around and to repeat yourself over and over then there are obvious and clear limits on how high level the language allows you to go.

So if for example register and memory allocation and the related finetuning is actually directly relevant to the programming problem you need to solve with your code and something you actually need to talk about in your code then I'd say that assembly language is a high level for you in that thing. A lower level language would try to put barriers between you, the registers and the memory and make you talk about (in the code) and concentrate on irrelevant details (by making you write extra code to get around the limitations or rules of the language).

If however you need to say something (in code) that would just get cluttered up if you had to talk about registers and manual memory management then using a language which doesn't allow you to hide those details somewhere in the background would force your code to be low level.

Writing code takes time no matter if the piece of code you are working on is relevant or irrelevant to solving the actual problem. The only code you absolutely must write is the code which describes the problem. The irrelevant stuff is just an extra cost in terms of time and work.

Of course writing type declarations and so on can be seen as an extra cost and irrelevant but it can also be seen as a kind of an insurance and therefore it can still be considered justifiable as a way of saving time that might be spent later on debugging the code for type errors.

From this point of view it is IMHO pretty poinless to speak about C, C++, Java, Lisp, assembly and so on as either low or high level languages in absolute terms as it all depends upon what you are going to write and what libraries you can use for it.

For the stuff these so called HLLs usually get used for they are more high level than assembly would be as solving the same problem in assembly would require more attention to details which would irrelevant clutter in the context of that particular problem.

All of this ties into the level of abstraction i.e. that of how well you can hide the details you don't want to bother with but instead want to automate using some other piece of code. Abstraction allows being lazy. I prefer to be lazy.

This is how I see it.
Post 26 Aug 2013, 10:04
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777
edfed: Not sure if I understand you correctly. I'm merely defending my style and explaining why I don't use C/C++ anymore and never liked Microsoft/MASM's standards or their decision to rename call to stdcall/invoke.

COMPARE

My Future Macro Language...
Code:
try p=allocate 4*KB 
try open name 
read p, 4*KB 
close    
Code:
try p=load.file name ; or entire file    
Real Smart Assembler. Written in a clear, professional style in a general fashion for easy portability.
Code:
call allocate, 4096
mov [p], r0 
test r0, r0 
jz .r 
call open, name 
mov [fp], r0 
cmp r0, -1 
je .r 
call read, [p], 4096 
call close    
Standard/Stupid/So-Called "Assembler".
Code:
invoke HeapAlloc, [_heap], 0, 4096 
mov [p], eax 
test eax, eax 
jz .r 
invoke CreateFileA, name, GENERIC_READ \ 
 or GENERIC_WRITE, FILE_SHARE_READ, 0, \ 
 OPEN_EXISTING, 0, 0 
mov [fp], eax 
cmp eax, -1 
je .r 
invoke ReadFile, [fp], [p], 4096, tmp.rw, 0 
invoke CloseHandle, [fp]    
How did this become "standard"?
Post 26 Aug 2013, 10:25
View user's profile Send private message Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
TmX wrote:

They are defined by formal specifications which are handled by institutions (C/C++: ISO, Java: JCP).


Ugh & argh. Design by committee. We all know what that leads into. Wink

Add everything including the kitchen sink to please everyone and no one is happy in the end because of the extra complexity and bloat.
Post 26 Aug 2013, 11:29
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
nyrtzi wrote:

Ugh & argh. Design by committee. We all know what that leads into. Wink

Add everything including the kitchen sink to please everyone and no one is happy in the end because of the extra complexity and bloat.


C++ is the worst in this case, I think.

Java is less complex than C++. Not bad, but not beautiful either (as usually dismissed by Ruby/Lisp folks).
Fortunately if you don't like Java that much but can't move away from Java platform,
there are alternatives like Scala, Clojure, JRuby, etc.

C is the simplest of the three. Probably I'll never write big apps in C.

Very Happy
Post 26 Aug 2013, 12:39
View user's profile Send private message Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
edfed wrote:

i understood, but i wanted to spot the detail about what resource is the problem. the problem is not the tool, but the human behind the scene.

then, you're true to tell the "Human" Resource is the problem.

maybe it's time to let ask the machines what is better for them.


Yes, it would be nice if all apps were time, space (memory) and energy efficient but that's not how the priorities go for business and people who just want a usable app done before the deadline and within the constraints of their budget.

Are the benefits of assembly big enough to justify using it for commercial projects anymore? Commercial software companies don't seem to think so. If using assembly would provide them with an advantage over the competition they would no doubt use it. But they don't. There is a conclusion to be drawn from that even if there were many possible reasons for it. If people want assembly language to become popular again they need to fix the problems that make people not want to use it.

Could we compare HLL vs asm to the situation between C and Lisp?

http://www.jwz.org/doc/worse-is-better.html
Post 26 Aug 2013, 12:45
View user's profile Send private message Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
uart777 wrote:
How did this become "standard"?


How does anything become standard? I doubt there is a simple answer for it but maybe it's related to the question of who gets to write history?

I'd prefer something like this:

Code:
(:= a-buffer (array char 4k))
(:= a-file (fs:file:open path-to-file))
(read a-file a-buffer)
(close a-file)
    


Or:

Code:
# (array char) after the ; specifies the type
(:= a-buffer (fs:file:read path-to-file);(array char))
    


You are working on a future macro language to make asm programming easier?

I'm thinking of how to make a better C by improving it one step at a time.
Post 26 Aug 2013, 14:11
View user's profile Send private message Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
TmX wrote:

C++ is the worst in this case, I think.


Amen to that.

TmX wrote:

Java is less complex than C++. Not bad, but not beautiful either (as usually dismissed by Ruby/Lisp folks).


Common Lisp is not small nor is it beautiful. I've never heard anyone call Ruby fast or memory efficient. In fact I've heard some Ruby stuff being unstable.

TmX wrote:

Fortunately if you don't like Java that much but can't move away from Java platform,
there are alternatives like Scala, Clojure, JRuby, etc.


Both Scala and Clojure seem a bit too complex for me to bother with.
I like both Lisp and functional but for the two above the learning curve seems a bit too steep for some weird reason.

TmX wrote:

C is the simplest of the three. Probably I'll never write big apps in C.


Yep, C doesn't really do that much to help with big apps. Oh well. Dunno if Forth works either. Probably not. Recently I've gotten hooked on the idea of proper type checking without the possibility to break it with casts and conversions.

Then again what is true about C is even worse with assembly. Even less support for static checks and so on out of the box.
Post 26 Aug 2013, 14:22
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
nyrtzi wrote:

I've never heard anyone call Ruby fast or memory efficient. In fact I've heard some Ruby stuff being unstable.


I'm comparing Ruby with Java, not C++.
Ruby probably isn't the #1 in fastest execution or memory efficienty,
but it's a nice language. One of the most popular web frameworks is
Ruby on Rails, which is obviously written in Rails.

nyrtzi wrote:

Both Scala and Clojure seem a bit too complex for me to bother with.
I like both Lisp and functional but for the two above the learning curve seems a bit too steep for some weird reason.


I can understand that. Some folks see those language as "too complex".
Personally I'm interested in Scala, mainly because of my background as a Java programmer, and my interest in Haskell.
Whatever floats your boat, I guess.

nyrtzi wrote:

Then again what is true about C is even worse with assembly. Even less support for static checks and so on out of the box.


Interesting. Could you explain more about this? Smile
Post 26 Aug 2013, 14:48
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 20:03; edited 1 time in total
Post 26 Aug 2013, 16:46
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
then, if we want fasm used as a standard, it is maybe time to write a sort of fcc, something to generate fasm assembly from c/c++.

and then, we will see if the world don't want to change.

if fcc is like fasm, compile process would be very easy:
Code:
fcc project.cpp project.bin
    


and voilĂ !
Post 26 Aug 2013, 17:27
View user's profile Send private message Visit poster's website Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
HaHaAnonymous wrote:

How to fix laziness of people? There's no cure for this yet.

Tell me if you find it!


Laughing You know that ain't gonna happen. Aren't we writing macros exactly because we are lazy too?
Post 26 Aug 2013, 19:15
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 20:03; edited 1 time in total
Post 26 Aug 2013, 19:38
View user's profile Send private message Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
HaHaAnonymous wrote:

I just support/use macros to speed up repetitive tasks out of code


Which is what I meant. Using a macro to lessen the amount typing required is a form of positive laziness. Many programmers are constantly looking for ways to get more functionality implemented with less work as you most certainly know.
Post 26 Aug 2013, 20:26
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777
Quote:
Aren't we writing macros exactly because we are lazy too?
No. I write macros+languages mainly for portability (X86+ARM+MIPS+Bytecode) and to increase production. No one understands me, what I'm doing or why, but you can make up your own reasons and believe them as if they were reality.

Quote:
we shouldn't consider the language and the libraries as separate entities
Do you understand the differences between a language/syntax and library (a collection of data/functions)? How many languages and libraries have you written?


Last edited by uart777 on 26 Aug 2013, 22:56; edited 1 time in total
Post 26 Aug 2013, 20:48
View user's profile Send private message Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
edfed wrote:

then, if we want fasm used as a standard, it is maybe time to write a sort of fcc, something to generate fasm assembly from c/c++.

and then, we will see if the world don't want to change.


I'd rather keep C and C++ separate from each other as they are two completely different things. C is small and messy but still pretty simple. C++ is big, messy and complex.

A C/C++ to fasm translator? You might get that done by just tweaking some existing compiler. I don't see much point in making one though. The only use I see is that we could use the output to show what kind of a mess C++ is under the hood but then again we can already do that with the existing C/C++ compilers by just looking at some of the intermediate files generated by a compiler.
Post 26 Aug 2013, 21:56
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1408
Location: Toronto, Canada
AsmGuru62
C is beautiful and not messy at all.
C++ is great language too -- used in its basic form.
Post 26 Aug 2013, 22:14
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4, 5, 6  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.