Page 2 of 27 FirstFirst 1234512 ... LastLast
Results 41 to 80 of 1068

Thread: LightFusion™

  1. #41
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: LightFusion™

    This seems very interesting. It's how win32 exes are structured, and can come in handy for people who are making compilers:

    http://www.madchat.org/vxdevl/papers...ile/pefile.htm

  2. #42
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: LightFusion™

    Have you considered just converting the code from your language into ASM and having an ASM compiler do the work for you?

    Dare I say that would be much easier than writing another compiler CornedBee

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #43
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: LightFusion™

    would this language be platform indepentent, or just run on Win32?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  4. #44
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: LightFusion™

    Quote Originally Posted by chemicalNova
    Have you considered just converting the code from your language into ASM and having an ASM compiler do the work for you?

    Dare I say that would be much easier than writing another compiler CornedBee

    chem
    As I said, the thing emitted Alpha Assembly and expected the user to manually feed it to the assembler and linker.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #45
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: LightFusion™

    Quote Originally Posted by tr333
    would this language be platform indepentent, or just run on Win32?
    Well I could make it to where you can compile it to use on any computer (Mac for example), but that would be double the work.

  6. #46
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: LightFusion™

    Oh, once again we're at the language/library boundary. Making a language platform-independent is easy. The only problem is that you need more than compiler - but if you, for example, write the compiler as a GCC front-end, you get that for free.

    The libraries, however, need to interface with the OS to do anything meaningful, so yes, there platform-independence would be a lot of work.
    On the other hand, it's not necessarily you who must do the work. If you simply design the libraries so that they don't clearly favour one OS, you can then implement them for the OS you're using and leave the porting to other people.

    Take a look at C#, for example. Porting C# itself was simple and done in the Mono project within a few weeks, I think. Writing the CLR wasn't too hard either. The real issue is porting the .Net framework, especially the System.Windows.Forms namespace, which is extremely clearly modeled after the Win32 model, thus making implementation on top of X Windows all but impossible - the Mono project uses the WINE WinAPI implementation for this namespace.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #47
    Member Yhoko's Avatar
    Join Date
    May 2002
    Posts
    47

    Re: LightFusion™

    Syntax idea

    What about functions?

    Code:
    public float Dist( int x, int y )
    {
        return ( x*x + y*y ) ^ 0.5
    }
    
    // Usage:
    float d = Dist( 10, 20 )
    Function data type in the header and -of course- return using 'return'


    Code:
    public int, int NegPos( int x, int y )
    {
        return -x, -y
    }
    
    // Usage:
    int x = 10
    int y = 10
    
    x, y = NegPos( x, y )
    I don't know a language that supports this, but it would make many things easier...
    - Yhoko


    Try my Games
    * [VB6] YDK - Yhoko's Development Kit
    * [VB6] HackV1 - two-player puzzle/strategy
    * [VB6] Xen - extended Gen

  8. #48
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: LightFusion™

    Python can more or less do it. It is a great future I often miss. But using references or structs can solve the problem too.


    - ØØ -

  9. #49
    Member Yhoko's Avatar
    Join Date
    May 2002
    Posts
    47

    Re: LightFusion™

    Yeah but it blows up code... in PHP I use arrays to return multiple values, that would also be a way (better support arrays AND the sample above

    Code:
    public int, int NegPos( int x, int y )
    {
        return array( -x, -y )
    }
    
    // Usage:
    int pos[1] = array( 13, 37 )
    
    pos = NegPos( pos[0], pos[1] )
    - Yhoko


    Try my Games
    * [VB6] YDK - Yhoko's Development Kit
    * [VB6] HackV1 - two-player puzzle/strategy
    * [VB6] Xen - extended Gen

  10. #50
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: LightFusion™

    Functional programming languages all support this through tuples. I'm not convinced it's worth its code complexity in imperative languages, though.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #51
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: LightFusion™

    Guess it would be easier to do this:
    Code:
    struct POINTL {
        int x
        int y
    }
    
    POINTL NegPos(int x, int y)
    {
        return new POINTL(-x, -y)
    }

  12. #52
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: LightFusion™

    That was my point two three posts up though...


    Or

    Code:
    public void NegPos(ref int x, ref int y){
        x = -x;
        y = -y;
    }

    - ØØ -

  13. #53
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: LightFusion™

    Multiple assignment

    Consider this
    Code:
    x = x * 2;
    y = y * 2;
    z = z * 2;
    now this:
    Code:
    x, y, z = ! * 2;
    (! = Insert appropriate symbol to represent each item).

  14. #54
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: LightFusion™

    Quote Originally Posted by penagate
    Multiple assignment
    Now that is a nice idea!

    Going back to the abovepost about

    x, y = blah()

    You can do this in .net anyway (sort of) using out params (in c#) and byref in VB.
    I don't live here any more.

  15. #55
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: LightFusion™

    Quote Originally Posted by wossname
    You can do this in .net anyway (sort of) using out params (in c#) and byref in VB.

    Ehhh...byref is the reference way......

  16. #56
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: LightFusion™

    I found this book right here:

    http://www.bookpool.com/sm/0471113530

    After Labor Day, I'm gonna go check it out over at Barns & Noble, and see how good it is.

  17. #57
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: LightFusion™

    Quote Originally Posted by NoteMe
    Ehhh...byref is the reference way......
    Your point being?
    I don't live here any more.

  18. #58
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: LightFusion™

    Quote Originally Posted by wossname
    Your point being?

    That it has been said many times now..


    - ØØ -

  19. #59
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: LightFusion™

    Quote Originally Posted by penagate
    Multiple assignment
    Code:
    struct Point3D
    {
      int x, y, z;
    
      Point3D & operator *=(int val) {
        x *= val;
        y *= val;
        z *= val;
        return *this;
      }
    };
    
    Point3D pt;
    // ...
    pt *= 3;
    Valid C++. Operator overloading rules.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  20. #60
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: LightFusion™

    Hehe...never thought about that.. hehe...you can do that in C# too the.. And soon VB.NET too..


    [Edit]The funniest thing is that I have all ready done it many places like in my Vector class and not even thought about it before...

    - ØØ -
    Last edited by NoteMe; Sep 5th, 2005 at 10:00 AM.

  21. #61

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: LightFusion™

    Ok, so just incase I didn't hint at it enough, I am going to state it clearly: I have to back out of this project. I realized I can't afford to even be posting here often (after school starts) and really can't afford to be making a compiler and a new language. But I will definitely stay ontop of this thread and whats going on.

    I'm going to upload the full text of the first post as a .txt and let JR copy paste that into the first reply so he can edit it as things progress.
    Attached Files Attached Files
    Last edited by eyeRmonkey; Sep 5th, 2005 at 03:00 PM.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  22. #62
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: LightFusion™

    Quote Originally Posted by CornedBee
    As I said, the thing emitted Alpha Assembly and expected the user to manually feed it to the assembler and linker.
    Must have been one of those days I read something and remember what I want.



    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  23. #63
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: LightFusion™

    Quote Originally Posted by eyeRmonkey
    Ok, so just incase I didn't hint at it enough, I am going to state it clearly: I have to back out of this project. I realized I can't afford to even be posting here often (after school starts) and really can't afford to be making a compiler and a new language. But I will definitely stay ontop of this thread and whats going on.

    I'm going to upload the full text of the first post as a .txt and let JR copy paste that into the first reply so he can edit it as things progress.
    Don't worry. Leave the compiler stuff to me. I'm gonna pick me up a book on it sometime soon.

  24. #64
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: LightFusion™

    that mass multiplication thing is a good idea, 1 line of code like that, i'm a fan of that

  25. #65
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: LightFusion™

    But that, too, can be solved using templates and operator overloading. I could write something in C++ that would allow this syntax:
    Code:
    mass, a, b, c *= 4;
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  26. #66
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: LightFusion™

    What about this one?
    Code:
    a, b, c = sin(1 - !) + (! / 100);
    Totally silly example, but it shows (if I'm correct) that you'd need to write an operator for each expression. This would just be a compiler substitution.

  27. #67

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: LightFusion™

    Seeing the ! made me think that we should probably have some advanced math functions on the library (! = factorial - brush up on your pre-calc).

    I love the idea of mass equations (on multiple variables).
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  28. #68
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: LightFusion™

    Well, find some other symbol for it then Anyway, in the library you'd give it a function name, factorial() or something.

    Code:
    int factorial(int n)
    {
        int val=n;
        for (int i=(n-1); i=2; --i) {
            val = val * i;
        }
        return val;
    }
    Oops, forgot you don't like semicolons.... sorry
    Last edited by penagate; Sep 6th, 2005 at 10:55 AM.

  29. #69

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: LightFusion™

    Oh yeah, I meant to mention, it would be nice if we did our For loops like penagate just posted.
    [code]for ([assignment of counter variable], [rule], [increment]) {
    Code:
    }
    And I like doing returns like that also instead of
    Code:
    Private Sub Factorial() {
        Factorial = blah
    }
    I like
    Code:
    Private Sub Factorial() {
        return = blah
    }
    I think it increases readability a lot.

    We also definitley need single increment and single decrement operaters. I miss those a lot in VB.
    Code:
    a = a + 1 // is the same as
    a++
    // same applies to --
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  30. #70
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: LightFusion™

    My code I posted doesn't work (it goes into an infinite loop). But, the flip side is, I just coded my first working piece of assembly... w00t

    Code:
    int factorial(int n)
    {
    	__asm {
    		mov eax, n      ; number n
    		mov ecx, eax    ; initial multiplier
    LoopStart:                      ; loop through numbers
    		sub ecx, 1      ; reduce by one (n*(n-1))
    		imul eax, ecx   ; multiply number (n*(n-i))
    		cmp ecx, 2      ; loop down to 2
    		jne LoopStart
    	}
    }

  31. #71

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: LightFusion™

    Nice penagate. Are you interested in actually joining the project? Or are you just going to help from time to time.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  32. #72
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: LightFusion™

    I'll help out as much as I can in this thread. Don't know that I'll actually have the time to knuckle down and write a lot of code at once, at least not until mid November or so when my exams are over. Plus I have a few other things I am doing.

    Tell you what, I'll write you ASM-optimised functions for your library

  33. #73
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: LightFusion™

    The loop was infinite because you wrote = instead of == in the condition.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  34. #74
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: LightFusion™

    Quote Originally Posted by CornedBee
    The loop was infinite because you wrote = instead of == in the condition.
    I suddenly feel very small and stupid

    Too much VB

  35. #75

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: LightFusion™

    Quote Originally Posted by penagate
    I'll help out as much as I can in this thread. Don't know that I'll actually have the time to knuckle down and write a lot of code at once, at least not until mid November or so when my exams are over. Plus I have a few other things I am doing.

    Tell you what, I'll write you ASM-optimised functions for your library
    Great to have you!

    You'll probably be more active than me after tomorrow (when I start school).
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  36. #76
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: LightFusion™

    I gave up on the For loop, it always returned the input number for some reason. I used a While loop instead
    Code:
    int __stdcall factorial(int n)
    {
        int i = (n - 1);
        while (i > 1) {
            n *= i;
            --i;
        }
        return n;
    }
    A few things from that to add to the Lightfusion collection. While() block, *= operator (I like all these shorthand operators) and -- which eyeRmonkey alrady mentioned above.

    Edit: Oh and maybe the ability to pick calling convention
    Last edited by penagate; Sep 6th, 2005 at 11:50 AM.

  37. #77
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: LightFusion™

    I'm thinking of adding the ! operator for factorials. There might be a faster way to do it in assembly.

  38. #78
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: LightFusion™

    I do not think that factorial is an operation common enough to warrant an operator. Preserving ! for its C use of logical NOT seems to make more sense.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  39. #79
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: LightFusion™

    You could always use VBs version....

    <>
    or
    Not



  40. #80
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: LightFusion™

    You have to add IsNot()

Page 2 of 27 FirstFirst 1234512 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width