2013-09-17 23:23:23

while audio.playing(file) do
dfe.sleep(5)
--End

----------
Robjoy, AKA Erion
Visit my site for all the things I do and to contact me.
You can also stop by for a slice of Pi

2013-09-18 16:58:59

Hi,
Just tried to put that code in there, it runs fine but it won't actually exit dfe.  my code looks like this:
if key.pushed(key.a) and key.released(key.np1) then
audio.play(exit)
while audio.playing(exit) do
dfe.sleep(5)
end
dfe.exit()
end

not entirely sure what's going wrong here - the loop of the background ambience keeps playing but my keyboard and everything deactivates properly...
The Doctor.

My TARDIS: time and relative dimension in space machine.  its bigger. on the inside.  infinitely bigger on the inside.

2013-09-20 12:03:07

http://erion.tdrealms.com

2013-12-25 15:47:54

I want to help you to develop the engine
can you give the source code to me?
thanks

2013-12-25 22:54:51

Hi,
I was considering developing in this engine, but am currently thinking it is a little bit of a waist of time. I haven't heard anything in the way of updates for a hole year, so.
However, i'm not going to give up on it completely. I totally know what developing like this is like, trust me. big_smile.

Underworld Tech.
Accessibility from us, to you.
Visit us

2013-12-26 02:50:24

Robjoy said on Twitter some time ago that he plans to update it in 2014. Let's see how much that gets done, as I think 1.0 was supposed to be out already.

2013-12-26 06:26:05

I want it's source code, because it is under the MIT license witch is open source

2013-12-26 06:27:05

I want it's source code, because it is under the MIT license witch is open source
i want to help developing this project

2014-01-03 01:05:24 (edited by Ethin 2014-01-03 01:17:43)

Hi robjoy,
This is directly concerning DFE because I would like to discuss the compiler and how its going to work. there are a few things you must know in order to write a compiler.

You must know assembly language. For instance, you must know what a very simple program is in assembly language. This is a very simple file that does nothing, but contains the code
int main()
{
}
in assembly language. If you want to write a compiler, you must know what the following assembly source does
    .file    "asmtst.c"
    .def    ___main;    .scl    2;    .type    32;    .endef
    .text
.globl _main
    .def    _main;    .scl    2;    .type    32;    .endef
_main:
    leal    4(%esp), %ecx
    andl    $-16, %esp
    pushl    -4(%ecx)
    pushl    %ebp
    movl    %esp, %ebp
    pushl    %ecx
    subl    $4, %esp
    call    ___main
    addl    $4, %esp
    popl    %ecx
    popl    %ebp
    leal    -4(%ecx), %esp
    ret
Now this might seem easy, just paste it in! But there are a few things you must also know in order to do anything useful. Here is a simple hello world program in C, then assembly language:
C:
#include <stdio.h>

int main(int argc, const char* argv[])
{
printf ("Hello world!\n");
}

Assembly language:
    .file    "asmtst.c"
    .def    ___main;    .scl    2;    .type    32;    .endef
    .section .rdata,"dr"
LC0:
    .ascii "Hello world!\0"
    .text
.globl _main
    .def    _main;    .scl    2;    .type    32;    .endef
_main:
    leal    4(%esp), %ecx
    andl    $-16, %esp
    pushl    -4(%ecx)
    pushl    %ebp
    movl    %esp, %ebp
    pushl    %ecx
    subl    $4, %esp
    call    ___main
    movl    $LC0, (%esp)
    call    _printf
    addl    $4, %esp
    popl    %ecx
    popl    %ebp
    leal    -4(%ecx), %esp
    ret
    .def    _printf;    .scl    2;    .type    32;    .endef
This does the exact thing in C as the assembler source does. Both do the same thing.
You cannot convert source code to assembly language in lua. That requires another compiler like Gcc.
You must know another high level language like C, C++, fortran, go, objective C, objective C++ or ada. This is a definite requirement.
you must know the registers of the computers CpU architecture. For instance, a 32 bit CPU has eax, ax, etc, while a 64 bit system has rax, rbx etc.
You need to know machine language, or a way to convert the binary created by your compiler into executable, machine language code that can be executed directly without going through an interpreter. Maybe GNU bison would be another, better choice?


You should study these things before even thinking about writing a compiler.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-01-05 01:16:00

Hi Ethin,
See my answers below.

Ethin wrote:

You must know assembly language. For instance, you must know what a very simple program is in assembly language.

Incorrect. Assembly knowledge is not necessary, not for all compilation types. For bytecode compilers it is certainly not a requirement. For native code, it depends on whether you'd like to write a better compiler than industry standards, such as GCC on linux. If yes, I wish you good luck! If not, optimised assembly will work just as fine.

Ethin wrote:

If you want to write a compiler, you must know what the following assembly source does

I see your -S switch works great when using GCC! I assure you, that you need a far better knowledge if you'd like to write a native compiler in pure assembly. GCC output can be quite unoptimised, see the debug symbols GCC just included in your code. smile

Ethin wrote:

You cannot convert source code to assembly language in lua.

Incorrect, again. See this page, which is a line-based Lua VM opcode assembler.

Ethin wrote:

You must know another high level language like C, C++, fortran, go, objective C, objective C++ or ada. This is a definite requirement.

A very nice list of what GCC can compile indeed!, but there are other capable languages as well.

Ethin wrote:

Maybe GNU bison would be another, better choice?

GNU bison is a parser generator, for parsable, mainly interpreted languages. It has nothing to do with machine code. Note, Bytecode does not equal machinecode!

Ethin wrote:

You should study these things before even thinking about writing a compiler.

What makes you think that I haven't done so? Please do explain, because I am really interested how you managed to draw this conclusion.

While I appreciate your help, your tone really does not justify it - to me, it rather sounds like instructions from someone who has a bit of knowledge, which certainly would not be sufficient to create a compiler. And of course we know the saying: little knowledge is worse than having no knowledge.

Rob

----------
Robjoy, AKA Erion
Visit my site for all the things I do and to contact me.
You can also stop by for a slice of Pi

2014-01-05 07:56:39

Hi robjoy,
I understand your knowledge. However, if you want to write a compiler, you should know some assembly just in case you need inline asm. For instance, C++ and C have an inline asm support with the asm() method. I forgot the parameters, I'd have to check. How ever, that VM converter. Do you know what VM stands for? Virtual machine. By using that VM converter, you are doing exactly what Java does, it runs code through bytecode. We don't all like byte code because it is slow and has no memory management. You said:
Bison is a parser generator.
You are incorrect there. Bison can generate compilers, too. If you have read the entire bison manual, it only shows you how to generate parsers. It doesn't show you how to generate compilers. However, Bison isn't the best either. No compiler/parser generator is the best.
I talked about machine language. You don't need it, but its recommended. Oh, and before I go, you are quite wrong on some of your statements. Yes, I used -S for GCC to get that output, but I do know assembly. The 'ascii' statement is an assembly instruction. The issue with assembly is that assembly is, as I said, specific for that computer architecture. Another assembly command is 'asciiz', which does similar things as 'ascii'. Note: If you want to write a compiler, try Antlr3. Its tough to learn, but it can generate compilers as well. If you want to talk about this more, just add me to Skype, ethin39, and we'll talk this out.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-01-05 12:36:05

Hi Ethin,

Ethin wrote:

We don't all like byte code because it is slow and has no memory management.

This statement on its own really shows that you have hardly any knowledge of these things. You cannot seriously say that Java is slow, and that it has no memory management!
Both of these things, speed and memory management depend on the actual implementation. (ie. the Virtual Machine), Bytecode has absolutely nothing to do with it.
You would be surprised to know how many programs you use daily that are compiled in bytecode!

Ethin wrote:

Note: If you want to write a compiler, try Antlr3. Its tough to learn, but it can generate compilers as well.

I am baffled. If it can generate a compiler, which you are right, it can, why would I use it to write my own compiler? If it is generated for me, then it wouldn't be mine, would it? smile
This is like someone creating their own text editor by modifying notepad.
Also one more thing, just to clear the confusion. I said earlier that DFE will have its own compiler. If I was to write my own, DFE would be certainly not out this year, nor in the next. Even with the proper knowledge, it is a matter of years to create one, more if you are not working on it full time.
I am quite satisfied with the existing solutions, and rest assured, I definitely know what I am doing smile
Rob

----------
Robjoy, AKA Erion
Visit my site for all the things I do and to contact me.
You can also stop by for a slice of Pi

2014-01-06 01:34:06

Hi robjoy,
Sorry for the confusion about that, I didn't mean every java implementation. How about we just forget about this hole compiler stuff and continue with the normal discussion, shall we? You know that we both low the same stuff, and its, in battle comparison, sword against sword, with the exact power in both weapons. Its not possible to beat each other. However, robjoy, I do want to start programming in DFE again, but I'm so busy with everything, DM2 and such, and now I'm learning Vala because it is similar to c#. Otherwise, I'd be glad to talk to you on Skype.
Oh, before I close the discussion on the compiler, that is, the one I started, I have to say, I was write on the byte code. It has to be ran through an interpreter instead of direct execution of the byte code. Look at Python, for instance. That can compile .py code into .pyc, .pyo etc files, but you have to have python installed on your computer to run that program. A newbie isn't going to want to do that, are they? No. That's why I like languages that compile into direct binaries. Its because no interpreter is necessary to run the program. As I've said, interpreters are much slower than compiled programs because they not only directly execute the program, but they have to parse it line by line, which might be good for debugging and syntax error checking, but no one wants to install Python, Ruby, Perl, etc in order to interpret their programs.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-01-06 09:54:27

why did this discussion, or rather, battle,  started anyway? Seems as the main reason was to test what Robjoy knows when it comes to programming, in an attitude which, for me, seemed as: Hey, lets test how much he knows about this, because I might know better than he does.
Sorry to say, but that was how it sounded to me. However, I don't think that was the goal of this, but rather to come up with some great suggestions, which is of course always nice.

Best regards SLJ.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Facebook: https://facebook.com/sorenjensen1988
Twitter: https://twitter.com/soerenjensen

2014-01-06 12:19:28 (edited by robjoy 2014-01-06 12:21:11)

Hi,
@SLJ, this is how it sounded to me as well. While I don't mind suggestions, even corrections, since this is an open source project once we release the code, questioning someone's knowledge just because you know something is not going to end well.
I still don't understand how @Ethin got the notion that I was unaware of the techniques, or knowledge about writing or using compilers. Maybe he had an introduction to assembly class, and thought he'd show us how much he learned? big_smile
At any rate, I am open to discussions, as always!

Ethin wrote:

... I have to say, I was write on the byte code. It has to be ran through an interpreter instead of direct execution of the byte code.

Correct. I never said you were wrong concerning bytecode execution.

Ethin wrote:

Look at Python, for instance. That can compile .py code into .pyc, .pyo etc files, but you have to have python installed on your computer to run that program. A newbie isn't going to want to do that, are they?

A programmer, no matter how much of a newbie he/she is, will have to do that eventually. There is no way avoiding it.
As for an end user, I am not sure why you think that they'd have to install an interpreter separately. It is the programmers task to release their program in a proper format. Python programs, such as NVDA, other tools such as BGT, mainstream games having a Lua interpreter, all do that. You don' thave to install anything extra to run them.

Ethin wrote:

As I've said, interpreters are much slower than compiled programs because they not only directly execute the program, but they have to parse it line by line, which might be good for debugging and syntax error checking, but no one wants to install Python, Ruby, Perl, etc in order to interpret their programs.

This is an interesting insight. It seems then that all the Php, Ruby, Python, Java, HSP, Inform, Euphoria, Smalltalk  programmers, millions of people, are not included in your "noone" category.
Syntax checking and debugging happens even if you are using compilers that produce machine code.
Code interpretation can happen line by line, but nowadays there are far more efficient ways. This is why there are so many people developing lexers and parsers. Bytecode is most certainly not executed line by line. Thus, we cannot really categorise interpreted languages as just slow, line-by-line languages. To write a simple interpreter, line by line interpretation would work, but we are also talking about efficiency, which generates a whole new set of issues. But this is way beyond my post smile
As for interpreted languages being slow, yes, by nature they are slower than machine code. But quite often their speed is enough where speed is not important, such as scripting a game. Interpreted languages are getting more and more efficient, there are some quite amazing speed comparisons if you take the time to look for them.
Despite their slowness, they have a lot of advantages. Dynamic execution, duck typing, just to mention a few.
Please research this properly, because I really feel that a lot of things you have said are not based on neither experience, nor correct information.
By all means, I am not intending to instruct you. If you are interested, and seemingly you are, you have plenty of time to learn these things properly. One thing I am asking you however: next time, please do not draw conclusions hastily. As you see, they often result in confusion and thus not really contribute to our discussion.
Best of luck with DFE, once you have enough time to "mess" with it. As always, we are here to help, even so, since we are in alpha stage for now!
Rob

----------
Robjoy, AKA Erion
Visit my site for all the things I do and to contact me.
You can also stop by for a slice of Pi

2014-01-06 20:27:43

hi,
@robjoy. I must say i am really looking forward to the final release. I've messed around with DFE in my spare time, created little games and such, and when there is a compiler available and it has every feature you want in it, it'll be amazing. This is the first time i've heard of someone try to develop an open source audio games engine. Best of luck!

Underworld Tech.
Accessibility from us, to you.
Visit us

2014-01-06 20:31:42

OK OK OK OK OK! Robjoy, I must say, you are write here. NVDA, actually, was frozen into an executable. BGT just runs its compilation stages through a VM, exec.bin.
Can we just... please... close the hole thing about the compiler... or take it somewhere else? No, I Had no intention to 'show' you what I knew, I had no idea if you knew any of that; I wasn't testing you at all; I was just trying to ask you in a nice way if you knew any of those things. A compiler does take a while to write, indeed. However, I would like to turn this discussion into what it was before, so, discussion closed. End of compiler discussion, OK?

A few suggestions for DFE though

robjoy wrote:

Hi,
@SLJ, this is how it sounded to me as well. While I don't mind suggestions, even corrections, since this is an open source project once we release the code, questioning someone's knowledge just because you know something is not going to end well.
I still don't understand how @Ethin got the notion that I was unaware of the techniques, or knowledge about writing or using compilers. Maybe he had an introduction to assembly class, and thought he'd show us how much he learned?

This raises some interesting questions, rob joy.

First, I haven't taken an assembly class just yet, I have only read books, tutorials etc on it.

Second, as I said before, I had no intention to display my knowledge.

Third, you said that you were going to release the source code. I'd love to check it out, seeing as I am interested in learning new things all the time. I love to learn new programming languages, scripting languages, etc. I like to read, too, so I'd be glad to pick up a copy of that source code once it is released and check it out.

Forth, you said I was "questioning someone's knowledge just because you know something" and that it would "not  end well." I was not questioning anyone.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2014-01-10 06:10:18

@robjoy, BGT uses a Scripting language called AngelScript, that has it's own Bytecode compiler
and at second, if you want to make a bytecode compiler, you have to edit lua's source code because I think It hasn't any bytecode compiler
BGT uses AngelScript to provide a scripting language and a VM and a JIT compiler that AngelScript has
you can fined AngelScript at
http://angelcode.com/angelscript/
and at third, C and C++ compilers convert the code into assembly, then convert them into object code
and then, linkers link object files with libraries together, and your program is ready to use!
but, about assembly that Ethin mentioned, if you want to write bytecode compiler, you must know some kined of assembly instructions like push, pop, mov, add, sub, mul, div, global, extern, and the differences between intel syntax and AT&T (not required)
I have saw AngelScript's Source code, it use's some kined of assembly codes
GCC produces at&t syntax of assembly, but MSVC produces intel
it is not required to know, but I think mentioning it here would be better
previously, I did use MSVC
now, I'm not using it and I'm Using GCC with Code::blocks
but about memory management, and speed, it depends on the bytecode compiler and VM
not?