Page 1 of 1

Perl + C++ = ???

Posted: Wed Jul 08, 2009 6:28 pm
by derbon
Guten Tag, I want to learn how to use Perl and C++/Allegro so then the scripts can be used in the program.
so like how do i do that. YO!

like what falco and kendal are going to use what peter does in lua

like how do i do that
:)

Re: Perl + C++ = ???

Posted: Thu Oct 08, 2009 4:16 pm
by Dever98
Well from what I remember I think falco re-wrote lua into the engine BUT I've seen libarys that let you use lua and perl in C/C++
I'll see if I can get some links for you.

Re: Perl + C++ = ???

Posted: Thu Oct 08, 2009 11:08 pm
by hurstshifter
derbon wrote:Guten Tag, I want to learn how to use Perl and C++/Allegro so then the scripts can be used in the program.
so like how do i do that. YO!

like what falco and kendal are going to use what peter does in lua

like how do i do that
:)

looks like a job for google
http://tinyurl.com/yhwdwgy

Re: Perl + C++ = ???

Posted: Fri Oct 09, 2009 2:57 am
by Dever98

Re: Perl + C++ = ???

Posted: Fri Oct 09, 2009 9:18 am
by avansc
http://lua-users.org/wiki/LuaVersusPerl

id look at this first.

perl is much better than lua for lets say doing things in a commercial environment. datamining, etc.
but lua i believe is one of the if not the fastest interoperated languages, which makes it good for something like games.

it all depends what you wanna do with it. but you will be fine with lua in most cases.

Re: Perl + C++ = ???

Posted: Sun Oct 11, 2009 7:03 am
by Falco Girgis
Perl is meant for things like text manipulation, server-side scripting, CGI, and web-based applications. Lua was designed specifically to be embedded within C/++ applications. Lua is one of the fastest (the fastest that I know of) scripting language. Perl is one of the slowest.

Lua was written to be an embeddable scripting language. Perl was written to be a full-fledged standalone interpreted language.

If you plan to embed Perl into a C++ application, you can plan on enjoying shittier speeds and probably a harder time integrating the script with your application.

With that being said, if your application doesn't happen to be a game or isn't running on an embedded system, go for it. Just remember kiddies, programming languages have specific strengths and weaknesses by design. If there were a language that was good at everything, we would all be using it. You don't need to just be embedding <insert language here> just because you like the name or syntax.

So embedding Perl in a C++ application is not a bad idea. You stand to gain a lot from the power of Perl, but depending on what you want to do, it could be a dumb idea.

Re: Perl + C++ = ???

Posted: Mon Oct 12, 2009 11:21 am
by Trask
Interesting that you say all that Falco, considering that Perl was being used in ES at first, if I remember correctly. Did you guys know of the limitations of Perl and game dev at the time or did you learn about them as you went along and discovered Lua as a result?

I\\\'m just asking as a curious viewer, tis all, no sarcasm meant if it comes across that way. I personally didn\\\'t even look into scripting languages with game development until I started following you guys... it just never came up.

Re: Perl + C++ = ???

Posted: Mon Oct 12, 2009 11:32 am
by Falco Girgis
You have it all wrong.

We never used Perl as an embedded language. We used it as the language to create tools and support the development of the game. That's something that it's good at, and that's something that we still use it for to this day.

Perl was never used to do what we now use Lua to do. And there aren't "limitations" of Perl--consider the fact that it is EXTREMELY more capable than Lua. Lua doesn't have a 10th the capabilities that Perl does, but Perl was never meant to be an embedded scripting language.

Re: Perl + C++ = ???

Posted: Mon Oct 12, 2009 11:44 am
by Trask
Duh, that\'s right. Thinking back on it, it was used for tools... maybe I was thinking about the level editor, I believe that there was a time when Peter\'s scripts were doing jobs that the level editor couldn\'t/wouldn\'t. Even then, it didn\'t touch the engine in that regard.

Is Perl being used at all anymore? For tools and such in ES?

Re: Perl + C++ = ???

Posted: Mon Oct 12, 2009 6:09 pm
by dandymcgee
Trask wrote: Is Perl being used at all anymore? For tools and such in ES?
GyroVorbis wrote:We used it as the language to create tools and support the development of the game. That's something that it's good at, and that's something that we still use it for to this day.

Code: Select all

#---------------------
# Peter's DevCock
# Deadsky Dreamcast
# NPC Maker
# 1/15/08
#---------------------
;)

Re: Perl + C++ = ???

Posted: Mon Oct 12, 2009 7:05 pm
by Trask
I read that at work, didn't catch that line. Thanks ;)

Re: Perl + C++ = ???

Posted: Sun Oct 18, 2009 3:01 am
by Pyrogre
Perl is actually a pretty zippy language itself compared to the other popular scripting languages. I've seen it beat Python, PHP, and Ruby by considerable amounts in a benchmark I read online on a blog somewhere (I READ IT ONLINE!! ON A BLOG!! so it must be true z0mg)! But realistically take that with a grain of salt anyways, because the benchmarks were for server side scripting producing a web page (something Perl excels at).

For the PC and modern gadgets, they're all going to be pretty quick languages. Except PHP, which comedically failed miserably, taking last place by a mile in the benchmark I refer to. It's especially funny considering PHP is specifically built for web development and was the only language that was actually embedded right into the apache http server instead of being run through some kind of CGI layer. You can't really go wrong with any general-purpose scripting language to be honest though. It'd be interesting to compare their performance in an environment like the Dreamcast where you're limited to a small amount of memory and processing power.

I'll also just point out that Perl has been embedded in C++ games with great success, so it's definitely doable if you want to go that route. EQEmulator, a pirate bootleg server emulator for Sony's uber leet bestest MMO ever ever EverQuest, uses Perl exclusively for it's quest system. As you can read in their wiki, it is just as robust as the Lua wrappers for Elysian Shadows are/can be (albeit implemented in different ways, since it is manipulating server data and not really doing anything on the client-side [except through packets it ends up sending through the server engine], but the point still stands because you can still do a ton of powerful shtuff with it).

When it really comes down to it, Python > all! :twisted: Although I may take another look at Lua if it really is as light-weight and awesome as you people lead on, I'm a stickler for performance.

Now my personal opinion... don't use perl. Or PHP. Or lisp. At least for this purpose.

hint: python

Re: Perl + C++ = ???

Posted: Sun Oct 18, 2009 9:34 am
by eatcomics
I have to say that I'm impressed with what I've seen done with python and pygame, I'm prolly gonna start learning it and try and see what it can do on the iPod touch :)

Re: Perl + C++ = ???

Posted: Thu Oct 22, 2009 10:42 am
by Falco Girgis
Pyrogre wrote:I'll also just point out that Perl has been embedded in C++ games with great success, so it's definitely doable if you want to go that route. EQEmulator, a pirate bootleg server emulator for Sony's uber leet bestest MMO ever ever EverQuest, uses Perl exclusively for it's quest system. As you can read in their wiki, it is just as robust as the Lua wrappers for Elysian Shadows are/can be (albeit implemented in different ways, since it is manipulating server data and not really doing anything on the client-side [except through packets it ends up sending through the server engine], but the point still stands because you can still do a ton of powerful shtuff with it).
I hope you realize what a flawed comparison this is.

You're comparing a scripting language processing something at the server-side to a scripting language embedded into an application (that could potentially be running on a microprocessor) on the client side.

These two aren't even comparable. Sure, you can do the same things that we do with Lua in the ES Engine with Perl (or any other scripting language of your choice). But no, it wouldn't run a tenth the speed or be a tenth as efficient to implement. Lua was designed with these tasks in mind.

Re: Perl + C++ = ???

Posted: Thu Oct 22, 2009 10:46 am
by avansc
dont know where too put this. but anyways. falco. i tested out some ocaml shit. and its amazingly fast. significantly faster than lua.
i was surprized.. thought id just share that.

i know you can compile ocaml. but i did all the rest as interpreted only.