Jump to content

Codewerks


Josh
 Share

Recommended Posts

It outputs a .cpp and .h file. I am working out the #include system now. Hopefully I can work something out that will only rebuild files that need it.

 

The outputted code, when done, should be no different than what a person would normally program. Since I have companies that want to use the C++ source, I need to have something that looks nice.

 

Not completely sure this will work, but I am just splitting my time between MSVC and this right now.

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

negative people are awesome...haha.

 

Person 1: "I'm going to punch you in the face"

Person 2: "Why would you do that? That's pretty stupid."

Person 1: "Stop being so negative."

 

It looks like a BMax clone to me as far as syntax so if you can learn or already know BMax it looks like you'd pick it up pretty fast.

Link to comment
Share on other sites

if anybody is going to make a language that can rival C++ and the others it's going to be someone like Josh and Annika and Co

It actually is C++, since it runs through a C++ compiler. C++ is the only language out there that is supported on anything.

 

Like I said, I don't know if it is possible for this to do everything I want, but it does seem to be going pretty well. I'll keep working with both this and Visual Studio and see what comes of it.

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

Seems to work well enough, quite impressive really! I'm not sure how far you can take this but it has to help reduce the workload conciderably. Good solution.

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

Meh, I got bored on this stormy day with my team absent, so I'm playing with some syntax creation.

 


class Vec2
{
float x
float y

function bool SomeLogic()
	if self.x > 1
		return true
	end
end
}

class Vec3 extends Vec2{

float x
float y
float z

function vec3()
	return self
end

function vec3(x)
	self.x = x
	return self
end

function vec3(x, y, z = 0)
	self.x = x
	self.y = y
	self.z = z
end

function vec3 normalize()
	vec3 v
	float m

	m = sqrt(x * x + y * y + z * z)
	v.x = self.x / m
	v.y = self.y / m
	v.z = self.z / m
	return v
end

function float dot(vec3 v)
	return self.x * v.x + self.y * v.y + self.z * v.z
end

function string ToString()
	return self.x + ", "+self.y+", "+self.z
end

function bool SomeLogic()
	if self.x > 0
		if self.x == 1
			return true
		else
			if self.x >= 2
				return false
			end
		end
	end

	return false
end

function bool SomeLogic(int x)
	if x > 0
		return self.SomeLogic()
	else
		return super.SomeLogic() // calls Vec2.SomeLogic()
	end

end

}


vec3 a
vec3 b
string c

a = new vec3(1, 2, 3)
a.normalize()

if a.SomeLogic() == true
	print a.ToString()
end

c = a.ToString()

b = a
b.x = 5
b.y = 8.2

print a
print b
print c

array<int> d
array<int>[5] e
array<int>[5,5] f

d[foo] = 5
d[0] = 2

f[0][1] = 2


' - comment
// - comment
/* */ - comment block

; - allowed and simply stripped out
{} - allowed and simply stripped out
if(a > 0){ return true; }
if(a > 0) return true end
if a > 0 return true

case insensitive

associate and dynamic arrays

function overloading

 

I use to do syntax creation a lot when attempting to build better PHP templating libraries like Smarty. Of course, this is different, but the end result is the same. It parses everything and spits out what it really should do.

Link to comment
Share on other sites

You can just use a static lib if you want.

 

The command set is mostly staying the same. I'm not going to change any command unless there is a clear reason to do so, or if it needs to be made consistent with the naming rules of LE3 commands.

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

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.

 

The command set is mostly staying the same. I'm not going to change any command unless there is a clear reason to do so, or if it needs to be made consistent with the naming rules of LE3 commands.

That was the confirmation I was looking for and good news as I'm still working on my Leadwerks engine and keeping my options open.

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 not hard to add a command like this:

 

void SetEntityPosition(entity,x,y,z)

 

That calls this:

entity.SetPosition(x,y,z)

 

That's what I did with BlitzMax.

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

With all the confusion surrounding Codewerks I got confused myself. Am I correct in stating that this BMax-like language will only be used by you (Josh) and later converted to C++, build and shipped so that I (a customer) will work with a object-oriented (regardless of any wrapper methods like in your post above this one) C++ library, oblivious to the fact it was written in another language to begin with?

 

Thanks!

Link to comment
Share on other sites

If you are confused, I would not worry about it. You will get a .lib file written in C++, and that's all that matters.

 

I'm working with Visual Studio atm. I think I need to learn everything I can about C++.

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

I'm working with Visual Studio atm. I think I need to learn everything I can about C++.

Sounds like a great move. I'm encouraged by you taking your time before diving into the code and putting issues out the community for feedback before committing yourself :blink:

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

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...