[QUOTE=esalaka;26152610]Yeah, that. But in addition to the ideas guy having no consistent plan, we never started work on the stuff we actually would've needed.
But hey, at least we could almost play music. :v:[/QUOTE]
That's pretty much what went wrong!
We made all the stuff we *MIGHT* need, and nothing that needed at that stage in the development
[QUOTE=Chandler;26152359]The below code is illegal in C++, because two functions with the same name cannot return different types,
[cpp]
void function(void);
int function(void);
[/cpp]
and in C++0x, trying to cheat with the new function declaration syntax
[cpp]
auto function(void) -> double { return 3.235; }
auto function(void) -> char { return 'z'; }
int main(void)
{
double x = function();
char z = function();
}
[/cpp]
Obviously results in an error, though this one is one of ambiguity, rather than the compiler realizing they are returning different types.
//...
Also, I don't know if I mentioned it or not, but in the first working release of my implementation you'll be able to link to C libraries, so OpenGL, SDL, or whatever you want will be available. (It's definitely a goal of mine, as I think a self hosting implementation of Bentus would be just awesome)[/QUOTE]
C++ doesn't allow this, because:
[cpp]void func1(int);
void func1(double);
int func2(void);
double func2(void);
int main()
{
func1(func2()); //wtf do we do now?
}[/cpp]
And about available C linkage in your language - do you have (or plan to make) a tool to convert the C-headers?
[QUOTE=esalaka;26152610]Yeah, that. But in addition to the ideas guy having no consistent plan, we never started work on the stuff we actually would've needed.
But hey, at least we could almost play music. :v:[/QUOTE]
Almost? My build could play Extended Modules fine - streaming and buffered.
[editline]19th November 2010[/editline]
[QUOTE=Chris220;26152927]That's pretty much what went wrong!
We made all the stuff we *MIGHT* need, and nothing that needed at that stage in the development[/QUOTE]
What did we need?
We didn't have much content to implement. Though I was more interested in the back-ends more in the first place...
[editline]19th November 2010[/editline]
[QUOTE=Chris220;26152927]That's pretty much what went wrong!
We made all the stuff we *MIGHT* need, and nothing that needed at that stage in the development[/QUOTE]
What did we need?
We didn't have much content to implement. Though I was more interested in the back-ends more in the first place...
Menus! And more keys to memorize!
[IMG]http://i53.tinypic.com/ixf2w6.png[/IMG]
TFGH are the menu control keys. And there's still IJKL when you're ready for more!
So who's making the new thread?
DISCLAIMER -- I MAKE TWO EXTREMELY TERRIBLE JOKES IN THE FOLLOWING POST
[QUOTE=ZeekyHBomb;26152967]C++ doesn't allow this, because:
[cpp]void func1(int);
void func1(double);
int func2(void);
double func2(void);
int main()
{
func1(func2()); //wtf do we do now?
}[/cpp]
[/QUOTE]
Of course. I was merely stating however, that in bentus, this won't be the case, because there is a difference between a generator and a method. However, if I were to steal your example:
[code]
def func(none) -> int;
def func(none) -> double;
def func2(x:int) -> none;
def func2(x:double) -> none;
def main(none) -> int:
func2(func())
end
[/code]
Bentus won't compile the code, because your intentions are not explicit enough. It's too ambiguous. Now I'm not saying that something like
[code]
def func(none) => int;
def func(none) => double;
[/code]
is possible either. I was just giving an example where different returns would be possible. Specifically in cases without ambiguity. Take for instance the following (let's assume for the moment that bentus uses "<<" as some arbitrary printing operator. It doesn't)
[code]
class X(object):
key <<(y: string) -> File;
end
class File(object):
key <<(x: string) -> X;
end
def something(none) -> none:
x := X
x << "Returns File" << "Returns X" << "Returns File"
end
[/code]
This is the C++ way with which to "handle" the situation, and the C++ equivalent to this would be more than legal, however, what Bentus will let you do is
[code]
class X(object):
key <<(y: string) -> File;
key <<(y: File) -> ref X
end
def something(none) -> none:
x := X
x << "Returns File" << /* feed File an int */ << "Returns File"
end
[/code]
This isn't any magic either, which I'm trying to keep to a bare minimum within Bentus. This might be a bit confusing, but I haven't actually put it into a full on specification, and I just haven't taken the time to word the phrasing right. Effectively, you can overload a method, or operator's return type, as long as they do not share the same arguments, and likewise you can overload a method or operator's return type as long as they share the same return type. Think of them as two functions that just happen to have different output, from different input. They just have the same name. Like, if you were doing basic algebraic functions, and in a graph were told to graph f(x) = x^2, and f(x + 2) = x^2 + 3. Both functions have a name of f, but they have different input and output. That's all this really is.
I cannot guarantee that this will be in any implementation, but I think it would allow for an easier use of method chaining, and possibly even some LINQ-like features implemented in the userspace. Only time will tell, but I have had moments in C++, where I wish I could do with it what I can do in python, such as
[code]
'/'.join([x for x in r'C:\SomeLong\Directory\InWindows\'.split('\\')]).pop(0)
[/code]
As the static analysis of programs becomes better over time, I wouldn't be surprised if in about 10 - 20 years, someone could sit down with some overly slow language, such as Io, write a program in it, then sick a compiler on it, which results in a completed executable being popped out in a few milliseconds. Assuming the Australians haven't won the war. Yet.
[QUOTE=ZeekyHBomb;26152967]
And about available C linkage in your language - do you have (or plan to make) a tool to convert the C-headers?
[/QUOTE]
This is the next design issue I'll be tackling actually, and is going to affect the module system as well.
[sp]Time for a rant? :V[/sp]
Coming from a python background, I was originally going to use the from <directory> import <file>, and this was all well and good until I remembered that on windows, as well as the Xbox 360, that the use of a dynamic library is sometimes necessary, and to get some proper work with the OS, you need to run a __dllexport on a definition in the linker, and this is also most likely going to be the case in some way shape or form in future OS X versions (definitely not Lion, but possibly the next iteration, as Apple has been adding support for Windows based binaries since the intel switch. In fact OS X 10.5 can read the Windows PE binary format, but not execute the code), especially since OS X effectively uses dynamic linking for everything (this is partially due to the Mach-O format for the XNU kernel, but also because the speed with which FreeBSD can increase because of a shared library).
Because of Apple's ever increasing move towards an even more locked down system, I wouldn't be surprised if to load a dynamic library in the future, you'll need to treat it the same way you would treat a Windows DLL that is not linked into the app at compile time.
Regardless, the use of a __dllexport meant that at some point in the language's life, I would need to add an `export` keyword, and suddenly I had a conflicting definition of counterparts. "*Surely* the import keyword would perform the __dllimport equivalent for compiled code?", and this is something I want to avoid, because it brings into question how committed the language is to avoiding ambiguity (Do I make a special case for weird "side-effects" like the Lisp implementations that support File IO?, Do I say "well in this ONE SPECIFIC CASE, we decided to deviate because I enjoy lying to people"?), and could be horrendously confusing for newbies ("Oh man, I need import something, so I'm just going to pepper my program with export in the hope that it works!"). So I've opted to use import/export for the handling of dynamically linked libraries, and then I'm taking a page from C# (sort of), and Perl (also sort of). C# is a runtime oriented language. I think it's fantastic, but unfortunately it just can't run everywhere, especially on systems where you aren't given access to the memory pages for a JIT (coincidentally, this means that all consoles everywhere are incapable of using any sort of JIT, unless they are the vendor of said system, which is why you get XNA for the 360, but a statically compiled engine for the PS3). But because of C#'s runtime oriented focus on nearly everything, we end up with some interesting constructs that actually fit the language. Whereas in C++, the `using` keyword is used semantically as a "I am actively using this specific identifier", C#'s is used for the importing of runtime assemblies. "using System", means you are actually [i]USING[/i] the system. You don't need to already know what's in there. You just assume something is in there as you actively USE the entire library. But this statement doesn't apply to Bentus. It's a statically typed language. There are very few runtime constructs in the language (more info on that in the large post later. Just know that it involves Ada, and immutability, and LLVM being awesome :P), and because of this, we need to know BEFORE the compile time what we expect to `use`, and as such we use the `use` keyword for the importing of files.
To give an example, let's assume we've added a "game" module to extensions, which contains opengl, and openal.
[code]
from extensions.game use opengl, openal
[/code]
When bentus sees this, it knows to open the files located in <extensions/game/opengl.tus|openal.tus>, otherwise we'll wind up with undefined declarations, and the compiler freaks out, as it should, and then kills your firstborn child, which it should not. (But this is what happens when you invoke undefined behavior).
So let's just sum up how I'm handling external resources here: from, use, import and export. But I [i]need[/i] to be able to talk to C. C isn't technically foreign itself, only the precompiled libraries are. And I [i]could[/i] do what ooc does, which is just add the 'include' keyword, parse the C headers, and just go from there, but I would prefer a D language approach, which is to simply extern (nearly) everything. This has its downsides, for some libraries, but it can allow for the wrapping of different libraries. But these C headers aren't "extern", because technically outside of a bentus module, everything is externed. And we have exports and imports, for dealing with "outside goods", and while C is technically close to Bentus, it is a bit "foreign". So to extern a C function, one would do something such as:
[code]
foreign def rmdir(path:ptr char) -> int;
foreign def mkdir(path:ptr char, mode:mode_t) -> int;
[/code]
(We should have already defined mode_t as well :D)
So this is the way I'm currently going about it. Have the users write their own wrappers. I think it will contribute to my still retaining sanity in the long run.
[sp]I sure did rant a bit before actually answering the question. Sorry. [/sp]:ohdear:
[QUOTE=Chandler;26153706]however, what Bentus will let you do is
[code]
class X(object):
key <<(y: string) -> File;
key <<(y: File) -> ref X
end
def something(none) -> none:
x := X
x << "Returns File" << /* feed File an int */ << "Returns File"
end
[/code][/QUOTE]
[cpp]struct File
{
File& operator<<(std::string y);
};
struct X
{
File operator<<(std::string y);
friend X& operator<<(File y, X& x);
};[/cpp]
?
[QUOTE=Chandler;26153706]I cannot guarantee that this will be in any implementation, but I think it would allow for an easier use of method chaining, and possibly even some LINQ-like features implemented in the userspace. Only time will tell, but I have had moments in C++, where I wish I could do with it what I can do in python, such as
[code]
'/'.join([x for x in r'C:\SomeLong\Directory\InWindows\'.split('\\')]).pop(0)
[/code][/QUOTE]
What does this do?
It joins '/' with 'C:' 'SomeLong' 'Directory' 'InWindows' and then takes the first element ('/') again?
Whatever that is supposed to do, you can archive some of the functionality by returning functors, though a proper LINQ-like system would of course be prettier.
[QUOTE=Chandler;26153706]So this is the way I'm currently going about it. Have the users write their own wrappers. I think it will contribute to my still retaining sanity in the long run.[/QUOTE]
So, I guess you will provide a tool to do quick conversions of C-headers to Bentus-modules then? Like [url=http://www.digitalmars.com/d/2.0/htomodule.html]htod[/url]?
[QUOTE=Chandler;26153706][sp]I sure did rant a bit before actually answering the question. Sorry. [/sp]:ohdear:[/QUOTE]
d/w
They're very interesting; I like reading your rants :)
Though this one could have had a little more vertical spacing..
[editline]19th November 2010[/editline]
[QUOTE=ZenX2;26153105]Menus! And more keys to memorize!
[img_thumb]http://i53.tinypic.com/ixf2w6.png[/img_thumb]
TFGH are the menu control keys. And there's still IJKL when you're ready for more![/QUOTE]
Your algorithm for intersecting lights is clearly wrong :colbert:
The cyan area is to bringt.
[editline]19th November 2010[/editline]
[QUOTE=ZenX2;26153105]Menus! And more keys to memorize!
[img_thumb]http://i53.tinypic.com/ixf2w6.png[/img_thumb]
TFGH are the menu control keys. And there's still IJKL when you're ready for more![/QUOTE]
Your algorithm for intersecting lights is clearly wrong :colbert:
The cyan area is to bringt.
[editline]19th November 2010[/editline]
Is every automerge a double-post now?!?
[editline]19th November 2010[/editline]
Is every automerge a double-post now?!?
[QUOTE=ZeekyHBomb;26153895][cpp]struct File
{
File& operator<<(std::string y);
};
struct X
{
File operator<<(std::string y);
friend X& operator<<(File y, X& x);
};[/cpp]
?
[/quote]
My point was placing both of those within one class, rather than using two (which I did in my first example ;D)
[QUOTE=ZeekyHBomb;26153895]
What does this do?
It joins '/' with 'C:' 'SomeLong' 'Directory' 'InWindows' and then takes the first element ('/') again?
Whatever that is supposed to do, you can archive some of the functionality by returning functors, though a proper LINQ-like system would of course be prettier.
[/quote]
Not quite, it joins the list returned by the comprehension, which you did get right, by the character '/', then pops the first character from the string off, in this instance "C".
I was using it was an example of chaining methods without requiring the returned type to be the same as the previous one, but with the same usage. It wasn't the best example :P
[QUOTE=ZeekyHBomb;26153895]
So, I guess you will provide a tool to do quick conversions of C-headers to Bentus-modules then? Like [url=http://www.digitalmars.com/d/2.0/htomodule.html]htod[/url]?
[/quote]
Eventually, but it is not a priority right now :)
[QUOTE=Chandler;26154200]My point was placing both of those within one class, rather than using two (which I did in my first example ;D)[/QUOTE]
So, in your example File has no key<< at all? How would you /* feed File an int */ then?
[QUOTE=i300;26151202]Quickly made this to to my homework for me.
[img_thumb]http://ahb.me/Y7A[/img_thumb]
[img_thumb]http://ahb.me/Y7F[/img_thumb][/QUOTE]
Now if you'd just do one that does mine for me step by step please
[img]http://dl.dropbox.com/u/11782997/integral.gif[/img]
[img]http://dl.dropbox.com/u/11782997/integral2.gif[/img]
[QUOTE=ZenX2;26153105]Menus! And more keys to memorize!
[img_thumb]http://i53.tinypic.com/ixf2w6.png[/img_thumb]
TFGH are the menu control keys. And there's still IJKL when you're ready for more![/QUOTE]
[IMG]http://i55.tinypic.com/eu3fko.png[/IMG]
Looks right
The border between the cyan and blue still seems wrong.
Are you calculating the attenuated light from both lights [i]before[/i] additively blending them ?
[U][media]http://www.youtube.com/watch?v=45A8vMUtXlM[/media]
[/U] [code]
Lua fully working, made some premade lua gates for starters (random, beep, between)
and ofc debug for errors so it doenst instantly crashes
much work on mp, it can connect, make gates, but it doenst update it yet, so when you click on a switch, it doenst get send to all clients
And special for my classmates: made the facepunch game in a way that cheatengine cant hack starpos, and life.. and crashes when editing the score
Example save file: http://pastebin.com/Ra4sNBfn
[/code]
85 posts left guys, wait 84?
So whos making new thread?
83 left. I'm excited. Also I'm working on a random meme generator. Once again, it's for a friend.
Curious in what the new highlights will be. :v:
[QUOTE=Tobba;26156325]85 posts left guys, wait 84?
So whos making new thread?[/QUOTE]
I guess, since no one else has come forward, I shall make the new thread.
Maybe the light just looks wrong because it isn't often you see perfect point source light with hard edged obstructions casting hard edged shadows in real life?
What terrible start to a page.
Wow who let that guy start a new page
We need a script that can extract img_thumbs too.
[QUOTE=r4nk_;26157002]Wow who let that guy start a new page[/QUOTE]
Yeah, well at least r4nk_ didn't get page king.
[QUOTE=xAustechx;26157018]Yeah, well at least r4nk_ didn't get page king.[/QUOTE]
[i]Crosses you off the highlight list[/i]
[QUOTE=r4nk_;26157037][i]Crosses you off the highlight list[/i][/QUOTE]
Man stop playin'
[QUOTE=xAustechx;26157305]Man stop playin'[/QUOTE]
Who says hes using sarcasm?
Sooooo R4nk_ how about.. 50% cut off the price for my gautier for like.. placing me on top? :smug:
I changed the color scheme of my game. What do you guys think?
[img]http://i51.tinypic.com/2yw93cm.jpg[/img]
[img]http://i53.tinypic.com/2yybl0g.jpg[/img]
Also in game the background fades to darkness but lights up depending on how loud the sound gets in the song
If you can understand that.
Seriously Austech are you blind or something
[editline]20th November 2010[/editline]
If you have trouble (you do.. :frown:) picking colours that go well together check out something like [url]http://kuler.adobe.com[/url]
[QUOTE=xAustechx;26157439]I changed the color scheme of my game. What do you guys think?
[img_thumb]http://i51.tinypic.com/2yw93cm.jpg[/img_thumb]
[img_thumb]http://i53.tinypic.com/2yybl0g.jpg[/img_thumb]
Also in game the background fades to darkness but lights up depending on how loud the sound gets in the song
If you can understand that.[/QUOTE]
Apart from the fact the circles look like they're made in paint, looks good. :smile:
Austech, theres way to many background crap in your game, while watching your vid, i could bairly focus on the notes, you should make the bg not draw atention, so tht players can focus on whay keys to press
[QUOTE=r4nk_;26157549]Seriously Austech are you blind or something
[editline]20th November 2010[/editline]
If you have trouble (you do.. :frown:) picking colours that go well together check out something like [url]http://kuler.adobe.com[/url][/QUOTE]
I actually did use kulur, I guess I just suck at picking colors. :(
[QUOTE=Dotmister;26157566]Apart from the fact the circles look like they're made in paint, looks good. :smile:[/QUOTE]
Thanks, but they're actually SFML shapes. I use no sprites in my game at the moment.
[QUOTE=bromvlieg;26157581]Austech, theres way to many background crap in your game, while watching your vid, i could bairly focus on the notes, you should make the bg not draw atention, so tht players can focus on whay keys to press[/QUOTE]
That's weird, when I play the background doesn't draw my attention away at all. It seems to just blend in.
Edit: But then again, I am blind. :v:
I had this idea that someone should write a scrapper that chooses the top 25(or something) images in the thread that receive the most programming kings
[QUOTE=iPope;26157675]I had this idea that someone should write a scrapper that chooses the top 25(or something) images in the thread that receive the most programming kings[/QUOTE]
It's better to pick by hand, that way everyone has a chance of getting highlighted, not just the posts with ratings (also you'd end up with a lot of XKCD comics...).
Automating it is the lazy way anyway, the person who makes the thread should take the time to pick the highlights otherwise they shouldn't be making the thread.
Sorry, you need to Log In to post a reply to this thread.