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
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 27 Aug 2013, 15: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
HaHaAnonymous wrote:
Quote:

It seems you've completely misunderstood what I've said.

I knew you would say that, haha! This is not true.

If someone misunderstood, that was YOU! NOT ME!


So exactly what did I misunderstand and how?
Post 27 Aug 2013, 15:51
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
hem... this topics becomes a mma fight i see. :p
Post 27 Aug 2013, 18:55
View user's profile Send private message Visit poster's website 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 27 Aug 2013, 20:31
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777
edfed: No one is fighting. HaHa was just joking. Words in English can have different meanings (bad can mean good, girl can mean woman, lazy can mean smart or economical, not doing things the hard way for no reason).

nyrtzi: Lately, I've been on prescription Oxycodone so it's easy to get confused and be misunderstood. I'm only against the stupid "standard" and those who impose it (see Fresh-Lib+ASM-Writer). Questions:

What's the advantage of the Lisp syntax? It appears to take simple file I/O then add a bunch of pointless symbols to it, 25 symbols (:=-())(:=-(::--))(--)(-) Multiply this by the number of Lisp users worldwide.
Code:
(:= a-buffer (array char 4k))
(:= a-file (fs:file:open path-to-file))
(read a-file a-buffer)
(close a-file)    
Is ; the comment symbol? One could argue ; is the easiest symbol to type, being located on the home-row, right pinky. This is not just a matter of personal preference or design choice (like style or naming convention), it can be argued logically. It is a fact that ; requires less energy to type on 99% of keyboards than // or /**/ (could be optional). Another example: As a separator (draw.image, draw_image), . is easier to type than _ (requires shift then stretch, may be too small or in a weird location on some keyboards).
Post 27 Aug 2013, 22:26
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:

I'm only against the stupid "standard" and those who impose it (see Fresh-Lib+ASM-Writer).


Well I absolutely agree with you on that.
The "standard" looks verbose and clunky both of which are major turnoffs
for me in any language. Maybe the "standard" was the way big companies
tried to lower the barrier for assembly programming. By making it look
like C or something more like a HLL. Of course they failed as we can plainly
see from the end result. Either way your FML looks a million times better.
I see less pointless details having to be taken care of in it.

A standard quote:
“I object to doing things that computers can do.”
— Olin Shivers

The details can just go into a library for all I care. Smile
Post 28 Aug 2013, 14: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
uart777 wrote:

What's the advantage of the Lisp syntax?
It appears to take simple file I/O then add a bunch of pointless symbols to it,
25 symbols (:=-())(:=-(::--))(--)(-)


The advantage? A simpler AST with fewer datatypes to deal with, nesting of
expressions, homoiconicity (almost wysiwyg between the source code and the AST)
and the interchangeability between code and data (both are described with the same
structures and syntax) . These combined make it easier to write code which parses,
generates and manipulates code as data. Rather useful if you have a language which
specializes in handling that kind of data and has computational macros.

I'm still trying to figure out what would be the right way for me to bring macros into my
language considering that I'm supposed to make it a compiled language. Then again if I
could get a built-in compiler inside the runtime and compile whenever I'd need to like
Common Lisp does it. I'm hoping to figure out a design less bloated than Common Lisp
though.

For comparison:

uart777 wrote:

Code:
try p=allocate 4*KB 
try open name 
read p, 4*KB 
close
    



nyrtzi wrote:

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


Code:
(:= a-buffer (fs:file:read path-to-file);(array char)) 
    



uart777 wrote:

Is ; the comment symbol? One could argue ; is the easiest symbol to type, being located on the home-row, right pinky. This is not just a matter of personal preference or design choice (like style or naming convention), it can be argued logically. It is a fact that ; requires less energy to type on 99% of keyboards than // or /**/ (could be optional). Another example: As a separator (draw.image, draw_image), . is easier to type than _ (requires shift then stretch, may be too small or in a weird location on some keyboards).


Yes, there is that finger movement economy point of view as well.
Hadn't thought about that.

The semicolon ; is a separator and one of the things that separates my syntax from the
usual Lisp syntax. It's the thing you slap in between if you want to specify the type of
an expression. For comments I use hash #. For example:

Code:
1;int # just an integer
"abc";string # a string obviously
(fn (a;int b;int) (* a b));int # an anonymous function which multiplies two integers and returns an integer
(* 1;int 2;int);int # multiplies integer 1 with integer 2 and returns an integer
    


It's optional though. One of the things I'd like to put into the language is a kind of type
inference. The kind which looks at all the things that have their type specified already
either manually or automatically (a string can only be a string after all, right) and then fills
out the types for the rest of the expressions that make up a piece of code.

So if a C++ kind of parameterized generic template style would say
(specifying the type to fill in into the template):
Code:
(def F<T> (a;T b;T) (+ a b));T

(F<int> 1 2)
    


I'd just like to say:
Code:
(def F (a;?x b;?x) (+ a b));?x

(F 1 2)
    


Where the type of a, b and F's return value is figured out from the fact that F is called
with two integers and that the type variable ?x is used for all of them which leads to the
conclusion that a, b and the value of F must all have the same type and that type must
be "int" because that is the only type that matches with the type of the arguments.

The colon : is a namespace/package separator. I was thinking that a better C could
benefit from namespaces/packages.

I've also been thinking of how to deal with chaining struct member and array access
with pointers. I'm considering using dots and commas for that so that I could say the
following:

Code:
some-object.field    # for struct member access
some-array.3    # for the 4th (zero-indexed) cell
some-array,n    # for the (n-1)th (n being a variable) cell
some-array,(some function call)    # if you want to call a function to get the array index

# and they could be chained in the following way
family.members,(index-of "Anne" family.members).name,index-of-char-to-get

# while a pointer to a pointer to a char could be specified like this
# (a pointer to a C-style string)
str;char^^

# and the first character retrieved by dereferencing
str^.0    # just once and then using an index
# or by dereferencing twice
str^^

# the key to reading these is to read from left to right
    


I'm not thinking of making the language specifically OO so I haven't thought of putting in
any sugar for an easier way to call methods. It's more likely that I'd go for simple
function overloading based on parameter and return value types like (it would still be an
improvement over C):

Code:
(:= make-noise (fn (animal;dog) (print "bark!")))

(:= make-noise (fn (animal;duck) (print "quack!"))

(make-noise (make-a-dog))
(make-noise (make-a-duck))
    


Perhaps I should add struct inheritance. Not sure about that yet. Need to think more.
However this is one thing I'd like to solve as well (the expression problem):

http://www.ibm.com/developerworks/java/library/j-clojure-protocols/index.html#resources
Post 28 Aug 2013, 15:56
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777
Were you aware of the 25 symbols there? Smile To be a successful language/compiler designer/creator, one must be extremely self-critical and obsessed with perfection. No such thing as "good enough". But I see that you have the interest/desire and what it takes to make compilers.
Code:
; My first generic/toy "compiler" (if you will)
; written in C in 1998? 16BIT .COM files (ModeX)

int x=160, y=120

draw
pixel x, y, BLUE    
Quote:
Yes, there is that finger movement economy point of view as well. Hadn't thought about that.
We can't imagine how much one little nuisance or extra symbol effects all programmers worldwide. Anything that is the slightest problem for us could be a major problem on a global scale. I wonder how much arthritis this has caused. My knuckles are broken in different places.

INHERITANCE
Quote:
Perhaps I should add struct inheritance
Easy. Just insert the structure with no name, beginning label. Quick example:

Code:
structure Object
 integer x, y, w, h
ends ?object

structure Image
 void p
 inherit Object ; x, y, w, h
 ; ...
ends ?image    
PREPROCESSOR

FASM's preprocessor is much more complex than you're imagining. It takes time to learn and there are restrictions: can't use #, {}, !=, etc. Because .if eax!=ecx is actually .if eax! = ecx (where eax! is one name).

I'm the first one in this community to create a real macro language in FASM. I had to learn by myself with NO help. I could not find any example macros here to create/access variables, functions, arrays, etc, so I had to think of my own ways to do things.
Quote:
I've also been thinking of how to deal with chaining struct member and array access with pointers.... I'm considering using dots and commas
You mean replace -> with , How will you separate parameters if , is reserved? We shouldn't have to tell the compiler "this is a pointer to structure". It should know that by the declaration.

VAGUE ABBREVIATIONS

Quote from one of my articles: "Writing crystal clear code"...

Avoid vague abbreviations. Real words are easier to remember when you have 1,000s of identifiers:

* std: Meaning: "Sexually Transmitted Disease". Not a good abbreviation
* func: Pronounced "funk", nasty, dirty. "function"/"procedure" is clearer
* def: Pronounced "deaf". "define" is clearer
* var: "variable" is clearer. "var" results in having short type names with long identifier names:

GOOD
Code:
variable x, y, w, h

x=(screen.w/2)-(w/2)    
BAD
Code:
var theXCoordinate, theYCoordinate, theWDimension, theHDimension

theXCoordinate=(theScreen.itsWDimension/2)-(theWDimension/2)    
LIBRARY DESIGN

See attachment for example system structure/hierarchy.

Well, gotta get to work. Good luck, nyrtzi!

PS: Zymic server went down again - https://twitter.com/zymichosting/ (updates). My images and downloads disappear until they restore (1-4 days).


Description:
Filesize: 139.53 KB
Viewed: 6681 Time(s)

SYSTEM.JPG


Post 29 Aug 2013, 00:31
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
when coding a naive gui in asm, the first thing you don't think about is to create a layout, then, instanciate items inside, then, use setters to set items arguments, and then, use the setVisible(true) method to draw th item.

when coding in asm, you will call the item methods from within the same kind of code that determine the flag in setVisible(bool flag).

the HLL way based on "standard" gui design:
Code:
xor eax,eax;eax = false
cmp [thing],0
jne @f
inc eax;set eax to true
@@:
call [items+ebx+items.setVisible];assume eax is the flag

    


and the naive way used instinctivelly in asm:
Code:
cmp [thing],0
jne @f
call [items+ebx];here, assume ebx is the item index
@@:
    


as you can see, in the first case, you will always call the setVisible Method, and then, you will always compute the entire item list, while in the second case, you are free to do what you want, and here, the freedom is to ignore entirelly the item that should not be displayed...

in my opinion, it's the main problem in the standard HLL designs, cause it doesn't apply just to graphics, but in fact, everything is made this way, from a file operation to a signal processing, if you use c++/java, you will be forced to design your code like in the first example.

and of course, the resulting assembly will be far more bigger than the one in the first example.

then... i will maybe restart the dev of my lib, and try to implement it in c++, just to proove it's possible to think differentlly, and to see if the second method is faster.
Post 29 Aug 2013, 11:37
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1408
Location: Toronto, Canada
AsmGuru62
It depends on who writes this code, I think.
Once form or dialog opens -- all controls are considered visible, so
I usually hide them as needed:
Code:
if (<some hiding condition>)
{
        control2.Visible = false;
}
    

But, as you said, it is possible to determine a flag first and then call
or set Visible property:
Code:
bool    ctrl2Visible = ...;
...
control2.Visible = ctrl2Visible;
    

Then, of course, the useless call is made if control must remain visible.
I do not see, however, how it will make assembly larger -- property setting must be present in both cases.
Post 29 Aug 2013, 15:26
View user's profile Send private message Send e-mail Reply with quote
nyrtzi



Joined: 08 Jul 2006
Posts: 192
Location: Off the scale in the third direction
nyrtzi
uart777 wrote:
Were you aware of the 25 symbols there? Smile


Yes, I consider them mandatory. I know it's extra typing
but the simplest way to get generic nesting into the syntax.

uart777 wrote:

We can't imagine how much one little nuisance or extra symbol effects
all programmers worldwide. Anything that is the slightest problem for
us could be a major problem on a global scale. I wonder how much
arthritis this has caused. My knuckles are broken in different places.


Then again that needs to be balanced against using longer but also
more descriptive identifiers, variable names, etc. like you said.
Tradeoffs, tradeoffs... argh.

uart777 wrote:

Quote:
Perhaps I should add struct inheritance

Easy. Just insert the structure with no name, beginning label.


The thing is that I'm torn between different approaches of getting it done
on the conceptual level. Static structural inheritance? Composition and delegation?
Wrapping and unwrapping things in the style of algebraic datatypes?
However even with these all combined it feels like things are not flexible
and expressive enough. So I'm thinking of tagging types in a set-oriented manner
so that I could create named groups of types and then use those groups as
datatypes. Kind of like creating multiple class hierarchies in parallel
as needed without messing with the structure of the objects themselves.

Code:
# first the basic type hierarchy with inheritance
(struct Animal age;int)

(struct Dog (Animal) owner;str)

(struct Duck (Animal) canFly;bool)

(struct Swan (Animal) isBlack;bool)

# but if I want to pass in (as an argument) just birds, then what?
(define-typegroup Bird (Duck Swan)) # a Bird can be a Duck or a Swan

# after which I can define a function for the group type Bird
(define-function make-noise (b;Bird) (print "<bird noise>"))
    


Another question is if I'd like to group things according to the operations they
support. Kind of like Go which allows you to create an interface specifying a
bunch of methods and then everything that actually implements those methods is
automatically marked as something which implements the interface. Then again if
I use multimethods I'd need to go for something a bit unusual.

Code:
# the variable ? is a wildcard and says that we can ignore that argument.
# the variable _ means that the object in question has to applicable as this argument.
(define-behavior Can-Talk-the-Talk-and-Walk-the-Walk
  (walk ? _)
  (talk _ ?))
    


So basically any object can be the 2nd argument of the function "walk" and the first argument
of the function "talk" can be consider to be of the type "Can-Talk-the-Talk-and-Walk-the-Walk".

One other idea is that when a function is called with arguments it would simply look up the most
specific function that deals with the type and supports all the function calls it is used in inside
the function body.

Code:
(define-function combine (a b) (+ a b))

(combine 1 2) # the "+" function supports integers so this makes sense -> no error

(combine "1" "2") # if no "+" function has been defined for strings then "combine" for strings makes no sense -> error
    


Oh well. I have some other ideas as well but there is no
point in talking about all of them here in one post.

uart777 wrote:

FASM's preprocessor is much more complex than you're imagining.


I've always thought that it's a complex beast but I haven't really dug
into the details. I've seen people use it for things that I believe would
usually be difficult (if possible at all) with other macroassemblers' preprocessors.

uart777 wrote:

I had to learn by myself with NO help.


It's also a lot of fun to find areas/niches/topics/problems where
no one has gone before. Being a pioneer is always hard to some extent.
"To boldly go where no man has gone before" kind of feeling, right? Very Happy

uart777 wrote:

Quote:
I've also been thinking of how to deal with chaining struct member and array access with pointers.... I'm considering using dots and commas
You mean replace -> with , How will you separate parameters if , is reserved?


I was thinking of separating parameters with just plain old whitespace.

C uses . -> * [] and &. I was thinking of using just , . ^ ~ and () in a way
which is not directly comparable to how those things work in C.
The first big difference being the strict left-to-right ordering of operations which brings
the benefits of postfix syntax (no need to think about operator precedence or associativity
and no need to write extra parenthesis around everything to make it more readable).

Code:
char* a;     <->     a;^char
&a           <->     a~
a            <->     a
*a           <->     a^

a.b->c[3] == (*(a.b)).c[3] <-> a.b^.c.3

# the point of the , is that the thing following it is either a variable or a computation
c[idx] <-> c,idx
c[figure_out_index()] <-> c,(figure-out-index)

# when using a . the next thing is a constant number or a struct field name
user.name <-> user.name
an_array[3] <-> an-array.3
    


uart777 wrote:

We shouldn't have to tell the compiler "this is a pointer to structure".
It should know that by the declaration.


Yes. I'd like it even more if it could automatically figure these out.

uart777 wrote:

Avoid vague abbreviations. Real words are easier to
remember when you have 1,000s of identifiers:


And the shorter ones are often used for local quick and dirty variables anyway.

uart777 wrote:

Well, gotta get to work. Good luck, nyrtzi!


Thanks. Good luck to you too!
Post 29 Aug 2013, 16:49
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
but what about using very short names for a system label?

if we should use long names in applications, in order to don't have symbol conflict with system libs, you should use short symbols, but not as short as assembly.
or use longer symbols as you go upper in the programming level.

but if you use longer names in higher levels.... why continue to use the boring and strange symbols we meet in programming?

something like sql is of course a level over the level, but it cannot speak with lower levels. only lower levels can speak with a database. meaning the memory have no intrinsic intelligence, and no way to provide any extra power to the sytem, this gives the problem with database manipulation, you should make ugly controllers, many connection managers, some little database server and a lot of system services around, just to get the content of some tables... the idea behin using assembly is to optimise everything, but before to optimise anything, do you really speak to the machine directlly?

speak to the machine directlly is like talking to our body. our body don't care the high level things, it just understand low level stuff, and what understand strange statements is not the body or the brain, but the intelligence.

what is intelligence? is it based on ugly whiles, for, cases and #includes, or is it largelly over all this?

i think that anything that is not intelligence is low level, then, why continue to try to upper the level of the langages if it is never a real intelligence?

the fact is that intelligence in our brain don't have many level of runtime libraries or frameworks to separate the layers.

we have a very very huge amount of memory (something we cannot evaluate) and we have very simple mechanisms that looks clever, but are just as simple as H2 + O2 + sparkle = energy + water.

the concept behind HLL is to loose us inside a the psychiatric hospital of programming, and also to give us a job in the current IT market.
Post 29 Aug 2013, 21:47
View user's profile Send private message Visit poster's website Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777
edfed: Sorry, I don't understand you. For examples of good names, see FASM source code. Thanks for creating this post. It was my opportunity to identify the real problem: WinAPI, but we don't have a portable GUI replacement for it yet.

nyrtzi:
Quote:
Yes. I'd like it even more if it could automatically figure these out.
It (compiler) should handle the details:
Code:
#define structure typedef struct

structure { int x, y; } POINT;

POINT point;  // structure
POINT *p;     // pointer to structure

p=&point;     // standard C...
p->x=0;       // -> needed
draw(p);      // no & for p
draw(&point); // & for point

p=point;      // improvement.
p.x=0;        // much clearer
draw(p);      // without & ->
draw(point);    
Quote:
"To boldly go where no man has gone before" kind of feeling, right?
Smile I try to be unique, innovative and do things that no one else would do. Normal is boring, typical, nothing special, not exciting.
Post 30 Aug 2013, 01:31
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8864
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
could i suggest a visual language

probably what you gonna read below sound stupid, but,, i dont really care, i just want to let the next generation to code this, Laughing

Code:
+------------------------------------------------------------------------------+
| [form:1] -Example-                                                           |
+------------------------------------------------------------------------------+
|                                                                              |
| [static:1] -Program-            [static:3] -EXAMPLE ROBOT GUI-               |
| [combo:1]                                                 [button:5] -STOP-  |
|                                 [button:1] -START-                           |
|                                 [button:2] -CALIBRATE-                       |
|                                 [button:3] -HOME-                            |
| [static:2]                      [button:4] -GO-                              |
| [listbox:1]                                                                  |
|                                                                              |
+------------------------------------------------------------------------------+

[form:1]
.text = "Example"
.wh = 1000,500

[static:1]
.x = 30
.y = 40
.w = 100
.h = 20
.text = "Program"

[combo:1]
.xy = 30,60
.wh = 100,30
.text[3] = "M-Line 1", "M-Line 2", "M-Line 3"

[listbox:1]
.text[4] = "Line 1", "Line 2", "Line 3", "Line 4"
.filtered = listbox1_filtered()
.filtered = listbox1_filtered()

[button:1]
.wh = 100,35
.filtered = button1_filtered()
.filtered = button1_filtered()
    


the idea is like this,
the parser will try to make sense based on the ascii window form we draw,
so, if i specify button:1 width and height, and based on that, button:2, 3, 4 will get the same width and height. and x value as well as y value,

means, we dont need to mess so much control values, they should get align according to what we draw.

if no x and y, w and h specified, the parser will AI automatically based on our ascii picture.

function code will just in another file, basically, 2 files minimum,
1 = gui drawing + its property values.
2 = function code

ascii picture - COMMENT - (will not get parsed)


Description:
Filesize: 9.14 KB
Viewed: 6577 Time(s)

gui.gif




Last edited by sleepsleep on 30 Aug 2013, 03:21; edited 1 time in total
Post 30 Aug 2013, 03:18
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8864
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
the .filtered is onmouseclick, filtered, filtered and so on,
general event calling name.

i guess, board filtered those javascript event name, but i guess you guys know what i am talking about.

the idea of using [button:number] will make our life easier,
means, we dont have to crank our head for a suitable name for control,
just use number.
Post 30 Aug 2013, 03:19
View user's profile Send private message Reply with quote
uart777



Joined: 17 Jan 2012
Posts: 369
uart777
sleep: Not bad. Similar idea: Define the interface (dialogs/windows) in text-based script files then load/create dynamically at runtime. Example:
Code:
font 'SYSTEM'
dialog d1, 'Login...', w, h
label l1, 'User:', x, y, w, h
label l2, 'Password:', x, y, w, h
textbox tb1, '(name)', x, y, w, h
textbox tb2, '(password)', x, y, w, h
button b1, 'Login', x, y, w, h
button b2, 'Cancel', x, y, w, h    
Advantages: Easy, convert resource scripts. Disadvantage: Absolute coordinates+sizes depend on resolution (controls relative to dialog). We need custom "layout managers" with alignment: create, attach, return.

"For every 1,000 ideas I have, there's only time to implement one. Implementation is what takes time"
Post 30 Aug 2013, 07:49
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
here, i understand:
something is_this,'named this',and have these properties

uart777 wrote:
Code:
font 'SYSTEM'
dialog d1, 'Login...', w, h
label l1, 'User:', x, y, w, h
label l2, 'Password:', x, y, w, h
textbox tb1, '(name)', x, y, w, h
textbox tb2, '(password)', x, y, w, h
button b1, 'Login', x, y, w, h
button b2, 'Cancel', x, y, w, h    


i'd prefer this way to describe things.

This: is_something 'named this',and have theses properties

it respect the simple assembly syntax and have a more logical grammar.

Code:
font 'SYSTEM'
d1: dialog 'Login...', w, h
l1: label 'User:', x, y, w, h
l2: label 'Password:', x, y, w, h
tb1: textbox '(name)', x, y, w, h
tb2: textbox '(password)', x, y, w, h
b1: button 'Login', x, y, w, h
b2: button 'Cancel', x, y, w, h    
Post 30 Aug 2013, 10:00
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8864
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
let me detail a bit,
agreement on syntax, the way describing a UI object in ascii is almost hard to reach any agreement,

each person is affected by their culture, language exposure, and so on,

what is suggest is a initial parser (each programmer code their own parser) to fit the standard parser input.

so, here, the standard parser input would be 1 line 1 command style
Code:
dialog text "EXAMPLE"
dialog x 500
dialog y 10
dialog w 100
dialog h 100
button name button1
button w 10
button h 20
button filtered button1_filtered()
    


ok, i need to explain this ascii window picture, because it is so important,
because through this picture, we could solve, WHAT and HOW to modify.

and all this through ASCII picture,


another idea is, modern UI app should be slide left/right or roll up/down, i represent it below using ascii.

question: assume you need to add logic, close counter will send an email to business owner,
1. see ascii picture diagram
2. you know, it is [button:121], we deal with filtered from there.

Code:
+-------------------------------+
| [form:0] -window 1-           |
+-------------------------------+
| [static:1] -Select Category-  |
|                               |
| [button:1] -Point of Sales-   |
| [button:2] -Inventory-        |
| [button:3] -Account-          |
| [button:4] -Setting-          |
+-------------------------------+
| [form:1] -Point of Sales-     |  -Enter Opening-                            -Close Counter-
+-------------------------------+------------------------------------------+-----------------------------------------+
|                               |                                          |                                         |
| [button:11] -Enter Opening-   |  [static:111] -Amount-                   | [static:121] -Amount-                   |
| [button:12] -Close Counter-   |  [text:111]                              | [text:121]                              |
| [button:13] -Key In Sales-    |  [button:111] -OK- [button:112] -Cancel- | [button:121] -OK- [button:122] -Cancel- | 
|                               |                                          |                                         |
+-------------------------------+------------------------------------------+-----------------------------------------+
| [form:2] -Inventory-          |
+-------------------------------+
| [button:21] -Enter Stock-     |
| [button:22] -Check Balance-   |
    


i think, overall ascii picture is very important, crucial for other programmers to start understand how things work, like a blueprint,

if no blueprint, but code only,
it takes more time to see the overall picture.
Post 30 Aug 2013, 11:25
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
representing data like you do is not realist from the computer point of view
computer just view a string of bytes, not an ascii art.

the only way i think that can help to manage nested states would be a sort of treeview.

your 3 states described here would be childrens of form1, and can be coded like in hierarchical programming, just using simple text (simple when you know the syntax)
Code:
form0:
.locals: dd arguments and blah blah...
form1:
.locals: dd arguements,conditions,etc...
.states: dd state1,state2,state3
state1: 
.locals: dd stuff
state2: 
.locals: dd restuff
state3:
etc...
form2:
.locals: etc...
    


this way, you have a flat model with pointers to structures and stuff, and the CPU will execute it.

and to edit it, you both have the textutal way, and also the graphical way, if you have a graphical parser/compiler of course.... Smile

here, you don't have to change anything in the fasm compiler, then, it is a gain, cause you can caode the hll and the asm in the same source.

and interresting mode for fasmw would be to let the user choose to assign one file, or many files.

this way, you can compile multiple projects with just one F9 hit. the problem would be to tell the compiler what files to assign automatically
why not a sort of directive compile?
then, use a .asm file tohandle all the projects with the compile directive
Smile
everything is in the source, even the compilation commands Smile

the idea is then to let the coder use only the powerfull low level assembler/editor to work on everything


Last edited by edfed on 03 Sep 2013, 07:39; edited 1 time in total
Post 01 Sep 2013, 10:01
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
edfed wrote:
representing data like you do is not realist from the computer point of view
computer just view a string of bytes, not an ascii art.


"a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute."

from mitpress.mit.edu/sicp/front/node3.html

I'm just concerned about what would be the least cluttered way to express something.

edfed wrote:

everything is in the source, even the compilation commands. Smile

the idea is then to let the coder use only the powerfull low level assembler/editor to work on everything


I'm personally in favor of writing and using code as data and then interpreting it in different ways according to the situation. In other words I wouldn't generate code from a picture or a diagram but the other way around. I'd add documenting metadata into the code itself and then have different small programs generate different representations of what the code says. So instead of generating a code template from an UML graph describing data types I'd generate the graph from the code.

The code itself is the only authoritative source of documentation anyway as it is the only piece of documentation that can tell how the program actually works and what it does. Outdated documentation is often no better than fiction.

However to pull this off one would need to write the code in a way and with a language which makes the possibility for using it as data a realistic one. The simpler the syntax is the better the chances are for being able to use the code as data without having to write a full interpreter it.
Post 01 Sep 2013, 12:11
View user's profile Send private message 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.