Jump to content

Codewerks


Josh
 Share

Recommended Posts

I think it's a bad idea and you should just use C++. My first reaction to your example in your blog post is that clearly you are more comfortable with BMax and so you are trying to make a converter for yourself so you can code things in a BMax like syntax. If there is any validity to that, then honestly just learn C++. You are a smart guy and C++ offers a ton of flexibility and you would benefit yourself by learning it inside and out. The time it would take to write a converter would better be spent learning C++.

 

As far as less typing, on the users side (us) the amount of typing we do depends on how the API is setup. This can be seen in the way you setup the current API (very easy to use and not much typing) vs something like the DirectX API (complex and a ton of typing).

 

My thought is that introducing something like this is really going to lead to more trouble than it's worth. It might not look like it at first, but I think there are a ton of hidden issues that will come from this and that'll take time away from what's important.

 

[EDIT]

Your example doesn't seem to really show any sort of benefit also. I know it's just and example, but if you are trying to show us why this new language would be better, you should have an example that really shows this.

 

[EDIT2]

Also if you were to do something like this, which I don't agree with, then really make it shorter, something like:

 

Cls Vec3
{
pub flt x, y, z;
}

 

Then again most of this stuff can be accomplished with Macros in C++

Link to comment
Share on other sites

I dont remember reading this was to replace the languages currently being used by LE users .. but was simply a new language, firstly to help the conversion over to C--

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

OK, if Josh could describe the point of this new language we can better decide on what we think about it. My first reaction to a new language is almost always don't do it since there are very efficient languages out there already. Just learn those.

 

Creating another language that will compile to another language just says to me that someone doesn't like working with said language.

Link to comment
Share on other sites

The example I posted wasn't very extreme, but I believe the number of characters my language uses will be somewhere around 20% of what C++ requires.

 

I do understand C++. I have to in order to understand how to create efficient code. The problem is C++ involves a large amount of tedious unnecessary typing. For a large team where manpower is unlimited, this doesn't really matter. For a small team, it is very important.

 

Also, if I start using a lot of shorthand in C++, a company that licenses the source from me won't be too happy.

 

So me using this is a foregone conclusion. I am just wondering if anyone else would find this useful.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

OK, if Josh could describe the point of this new language we can better decide on what we think about it.

 

I thought he had on his blog?

 

My first reaction to a new language is almost always don't do it since there are very efficient languages out there already. Just learn those.

 

those? you mean the one you like? :)

 

Creating another language that will compile to another language just says to me that someone doesn't like working with said language.

 

I thought the initial idea was to speed up the conversion process of LE to C-- ? if it became at some stage a new product along side the other lanuages, I don't see the harm. Again it would be down to the individual to select what is best for them.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

I can't really see the meaning of making a C++ clone with your own syntax just to save some typing.

 

People who already knows C++ has to learn yet another language and its a languages that cant be used elsewhere,

and people that has no previous programming knowledge has to learn a language that they cant use for other

things than Leadwerks.

 

Of course I don't know the capabilities of this C++ clone, but I doubt it will produce better results than

using the original language. To me it looks like making an own LE-version of Blitz.

 

Another thing that worries me is the documentation of this language. The documentation of the engine could be

far better than its now. Just having a reference to a community driven Wiki is kind of weak documentation. Introducing

a new language would then make this shortage more obvious if the documentation is handle in the same way.

 

I cant see that introducing a new language should save costs for the industry. They already have programmers

that knows their C++. This would render in having them to learn this new language and that is really a big cost.

Time is money as you say. I don't by that argument at all.

 

I don't believe in spend time, creating new languages when there already is capable languages. If you fell that

C++ is troublesome I would recommend that you go for a C# (Mono) solution instead.

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

People who already knows C++ has to learn yet another language

 

 

Why? I still have not read anything that says it will be compulsory to use this "new" language.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

If you are using this new language simply as a vehicle to eventually produce valid C++ syntax and it works then fair enough, that seems a perfectly valid way of producing a larger bulk of code more quickly (a kind of coding shorthand if you like). However, if this is to simply convert existing BlitzMax structured code to C++ without any thought to redesign to take advantage of the destination language then I'd suggest you might get a less than optimal results. It's quicker and may well work but may not really utilise C++ to its full advantage. Only you can make the judgement call on this Josh as we have not seen (nor probably want to) the full source code.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Why? I still have not read anything that says it will be compulsory to use this "new" language.

 

I might have misunderstood this but in the blog Josh gives an example

 

Class Vec3 {    
       Field x:Float
       Field y:Float
       Field z:Float
}

 

I thought this was the substitute for

 

class Vec3 {
       public:
       float x;
       float y;
       float z;
       Vec3(): x( 0.0 ), y( 0.0 ), z( 0.0 ){}
};

 

Quite different.

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

Like Pixel said, if you implement this so you can use it to create a C++ version of LE 3, then you might miss some C++ advantages over BMax (because it seems clear that that's the syntax you are leaning towards in your example). From my understanding there are certain features that C++ has that BMax doesn't. I don't think it was a large list but there could be something of use in there that might not be considered because of this BMax like syntax. Clearly you've made up your mind though. Good luck. It'll be interesting to see how it plays out. My fear is that this new language turns into a monster of it's own and starts influencing the engine design.

 

 

Why? I still have not read anything that says it will be compulsory to use this "new" language.

 

I haven't either, but I haven't heard that about Lua either, but Josh mentioned that he was removing ini files eventually meaning that all those configurations for the objects in the editor have to have Lua files in them to work correctly in the editor. Is it mandatory, no, but unless you want to write your own editor you will be stuck with it. Lua started out with this same idea of being optional, but slowly over time it starts taking over certain aspects. If Josh ends up loving this new language are we really to believe that it won't work its way into being (realistically) mandatory at some point to some degree? Given past record I'd say at some level around the tools, it'll be "required", just like Lua is "required".

 

That's my fear.

Link to comment
Share on other sites

Well Codewerks could be called Cwerks ... should make you happy rick it starts with a "C" lol

 

If the idea of CMax .. sorry Cwerks is to spit out C-- code .. as you already code in the "end product" I dont see your concerns ..

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Like Pixel said, if you implement this so you can use it to create a C++ version of LE 3, then you might miss some C++ advantages over BMax (because it seems clear that that's the syntax you are leaning towards in your example). From my understanding there are certain features that C++ has that BMax doesn't. I don't think it was a large list but there could be something of use in there that might not be considered because of this BMax like syntax. Clearly you've made up your mind though. Good luck. It'll be interesting to see how it plays out. My fear is that this new language turns into a monster of it's own and starts influencing the engine design.

The code isn't BlitzMax, and object handling works a lot differently.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

So you are hand translating the BlitzMax into your intrim language then Josh, not using some BlitzMax to intrim language convertor? Basically using your knowledge of C++ to aid your translation and the resultant structure but speeding that up by using this intrim language. The intrim language then being converted into standard C++ syntax in a second automated phase. Would that be a correct assesment?

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

It's a whole new engine, although it uses a lot of existing code.

Does it have instancing?

 

It sounds like you have a handle on it, so use this convertor language. If it saves you years of writing code, who would be against that?

If you plan on eventually making is the LE language, then BAD idea, and you will lose support/customers. ie: GG

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Link to comment
Share on other sites

This isn't about forcing anyone to give up C++. Like I said, I could implement this and you wouldn't even know it.

 

Then I've got no problem with it. People who have bought the source code might have reason to complain, but not me.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

The next question that comes out of this is how similar is the API intended to be. I'm thinking along the lines of how easy or hard is it going to be to convert an engine based on leadwerks 2 to Leadwerks 3.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I uploaded my current version here:

http://www.leadwerks.com/post/codewerks.rar

 

The example program is myprog.txt. You can use the included Code Editor, or just run the .bat file.

 

Here is my current test program:

Structure Vec3

Field x:Float
Field y:Float
Field z:Float

Method Normalize:Vec3()
	Local v:Vec3
	Local m:Float
	m=Sqrt( Self.x*Self.x + Self.y*Self.y + Self.z*Self.z )
	v.x = Self.x / m
	v.y = Self.y / m
	v.z = Self.z / m
	Return v
EndMethod

Method Length:Float()
	Return Sqrt( Self.x*Self.x + Self.y*Self.y + Self.z*Self.z )
EndMethod

Method Dot:Float( v:Vec3 )
	Return Self.x*v.x + Self.y*v.y + Self.z*v.z
EndMethod

Method ToString:String()
	Return Self.x+", "+Self.y+", "+Self.z
EndMethod

Method Add:Vec3(v:Vec3)
	v.x=v.x+Self.x
	v.y=v.y+Self.y
	v.z=v.z+Self.z
	Return v
EndMethod

Method Subtract:Vec3(v:Vec3)
	v.x=Self.x-v.x
	v.y=Self.y-v.y
	v.z=Self.z-v.z
	Return v
EndMethod

Method Add:Vec3(f:Float)
	Local v:Vec3
	v.x=Self.x+f
	v.y=Self.y+f
	v.z=Self.z+f
	Return v
EndMethod

EndStructure


Class Entity

Field position:Vec3
Field rotation:Vec3
Field scale:Vec3	
Field parent:Entity

EndClass

Local a:Vec3
Local b:Vec3

a.x=3

b=a.Normalize()

Print a
Print b

'Produce divide by zero error:
'Local n:Int
'n=n/0

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...