Raised This Month: $7 Target: $400
 1% 

HLDS-V8: Extending HLDS with V8 JavaScript engine


Post New Thread Reply   
 
Thread Tools Display Modes
deejayy
Junior Member
Join Date: Mar 2005
Old 03-15-2014 , 18:07   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #21

I don't think Pawn would be hard. I think that there are tasks that you can't achieve in pawn because of its limitations.

Besides that, eg. you can't simply concatenate a string (face it, this is a very basic task). You can't simply use an associated array, you should use Tries instead, which are much complicated (for a very basic task, again).

For extending a HLDS functionality, you have to learn a new language which you can't use anywhere else.

You can't do clean code in pawn.

You can't do OOP in pawn.

JavaScript has proven. It is actively developed, standardized and the V8 engine is maintenanced by one of the biggest IT company in the world. Just compare release times, Pawn's last release date is 2012-06-22, the AMXX compiler uses a 2006 dated version.

Should i continue?

Anyways, i don't want to "rule the world" or something, i just want to use JS for extending HLDS. Since it hasn't done before, i should do it (though i can't code so good in c++, so the first version will be deterrent ).
__________________
deejayy is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-15-2014 , 18:28   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #22

Quote:
Originally Posted by deejayy View Post
Besides that, eg. you can't simply concatenate a string (face it, this is a very basic task).
strcat

Quote:
You can't simply use an associated array, you should use Tries instead, which are much complicated (for a very basic task, again).
Associated Arrays are not that big of a deal

Quote:
For extending a HLDS functionality, you have to learn a new language which you can't use anywhere else.
Not really. If you are familiar with C++, you can code Metamod modules. You are not forced to use AMXX to interact with HLDS

Quote:
You can't do clean code in pawn.
I guess that depends on your definition of clean

Quote:
You can't do OOP in pawn.
It was never designed to be OOP, which I personally don't find that big of a deal

Quote:
JavaScript has proven. It is actively developed, standardized and the V8 engine is maintenanced by one of the biggest IT company in the world.
JavaScript is not being developed, it is already developed (the last change to the language was in 2011). The engine that executes the JavaScript is what is being actively developed.

Just compare release times, Pawn's last release date is 2012-06-22, the AMXX compiler uses a 2006 dated version.[/quote]
AMXX uses an old compiler to remain backwards compatible

Quote:
Should i continue?
That is up to you. Do you really think you can support this type of project by yourself?

Quote:
Anyways, i don't want to "rule the world" or something, i just want to use JS for extending HLDS. Since it hasn't done before, i should do it (though i can't code so good in c++, so the first version will be deterrent ).
You sort of need to know C++ if you are expecting to implement a new language that will interact with Metamod
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
deejayy
Junior Member
Join Date: Mar 2005
Old 03-16-2014 , 05:42   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #23

Quote:
Originally Posted by YamiKaitou View Post

Quote:
Besides that, eg. you can't simply concatenate a string (face it, this is a very basic task).
strcat
Ehrm, sorry, i missed it, i often use concatenation with returned strings, that is what you can't achieve like:
Code:
getstring(...) + " is " + getstring2(...)
Quote:
Originally Posted by YamiKaitou View Post
Quote:
You can't simply use an associated array, you should use Tries instead, which are much complicated (for a very basic task, again).
Associated Arrays are not that big of a deal
Associated arrays are the first basic key-value "databases". I'm using it since i got familiar with programming, it makes easy a bunch of common tasks.

Quote:
Originally Posted by YamiKaitou View Post
Quote:
For extending a HLDS functionality, you have to learn a new language which you can't use anywhere else.
Not really. If you are familiar with C++, you can code Metamod modules. You are not forced to use AMXX to interact with HLDS
Yes, i can. And yes, i'm not (wait, are there any runtime for executing pawn bytecode without HLDS?). But it is unconfortable and difficult (for me, at least).
Can i write a 2 year expreience in Pawn in my CV? - i think not.


Quote:
Originally Posted by YamiKaitou View Post
Quote:
You can't do clean code in pawn.
I guess that depends on your definition of clean
KISS, DRY, SOLID.

Quote:
Originally Posted by YamiKaitou View Post
Quote:
You can't do OOP in pawn.
It was never designed to be OOP, which I personally don't find that big of a deal
I have a plugin which consist of 18 includes, every one of them is used for a specific task. The namespace has 117 functions and some globals. I had to name the functions by it's namespace and role to keep it maintainable. If there would be OOP, it will be much easier.


Quote:
Originally Posted by YamiKaitou View Post
Quote:
JavaScript has proven. It is actively developed, standardized and the V8 engine is maintenanced by one of the biggest IT company in the world.
JavaScript is not being developed, it is already developed (the last change to the language was in 2011). The engine that executes the JavaScript is what is being actively developed.
ECMAScript 6 is in a "work in progress" state.

Quote:
Originally Posted by YamiKaitou View Post
Quote:
Should i continue?
That is up to you. Do you really think you can support this type of project by yourself?
I mean, "Should i continue to count the reasons any further?", sorry for my english

But answering your question, i don't know, i just gave it a chance. I want to keep hlds-v8 as simple as i can, there will be fewest logic neccessary. I aim it to be a bridge between HLDS and JavaScript.

Quote:
Originally Posted by YamiKaitou View Post
Quote:
(though i can't code so good in c++, so the first version will be deterrent ).
You sort of need to know C++ if you are expecting to implement a new language that will interact with Metamod
Yes, i'm a software engineer, i know many languages, in time i will be comfortable enough with C++ to at least release a stable.
__________________
deejayy is offline
DaxProxy
Senior Member
Join Date: Sep 2007
Old 04-06-2014 , 18:40   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #24

About time someone started working on it.
Ignore YamiKaitou, if he seriously thinks that OOP is not that big of a deal, you obviously can't take him seriously.

He is just so in love with PAWN that his reasoning is beyond sober mind.

YamiKaitou, i know that you are well respected member of this forum, but JS is superior over PAWN in every possible way and i simply do not agree with any of your points.

Now my obvious question is, would it be possible to move this whole project over to NodeJS? I mean, imagine merging HLDS with existing NodeJS (npm) modules.

This project would literally revive Counter-Strike scene, everyone with even a slight mod idea can execute it. PAWN is such an abomination that it makes me sick every time i attempt to write clean code in it.

[Ignore my current profile, it's obselete, i've gained lots of experience these past years, attempted to make a run at PAWN, no...it's just waste of time, you have to run through flaming hoops to get even most basic ideas executed]
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739

Last edited by DaxProxy; 04-06-2014 at 18:47.
DaxProxy is offline
deejayy
Junior Member
Join Date: Mar 2005
Old 04-07-2014 , 00:57   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #25

DaxProxy, +1 to all of your words

On the beginning, i've searched for node.js embedding, but every forum/mailing list/idea exchange site sent me "how to include v8". I didn't find any source of embedding node.js, but it was the first goal. Embedding V8 was easy in a way

In the past weeks i was looking for a way to embed the whole node.js ecosystem despite no one have experience with that, i still don't know how will it end (and, if it success, how will it perform with that extra payload over V8 ). I was on the #node.js irc channel, everyone suggested me to write a node module, and i have to explain every one of them, that this is a module already, they suggestion is not an option.

Besides, i have a lot to do, i have some other projects (eg. decoding hlds protocol ).
__________________

Last edited by deejayy; 04-07-2014 at 01:00.
deejayy is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-07-2014 , 08:11   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #26

Quote:
Originally Posted by DaxProxy View Post
Ignore YamiKaitou, if he seriously thinks that OOP is not that big of a deal, you obviously can't take him seriously.
I feel OOP is only needed if the project needs it. I do not feel OOP is needed for everything. And, I don't deal with OOP languages that often (I only use OOP when dealing with MySQLi in PHP, though I don't code in various languages either)

Quote:
He is just so in love with PAWN that his reasoning is beyond sober mind.
Not sure how you got this conclusion

Quote:
YamiKaitou, i know that you are well respected member of this forum, but JS is superior over PAWN in every possible way and i simply do not agree with any of your points.
I never stated Pawn was superior than JS. I was simply commenting on various points he made. I'm fully aware that Pawn is out-dated, but if you look at the history of AMXX, you would see that they didn't have much of a choice back then (AMXX is a fork of AMX, which was already using Pawn. Even AdminMod used/uses Pawn). Sourcemod uses SourcePawn (which is their modified Pawn version) and at one point there was some development towards a new language custom built for Sourcemod. I have no issues with new projects, I just don't think HLDS is the place to go with it. I feel he would have more success in SRCDS given that HLDS is dying (albeit slowly, but still dying). If this project every takes off and gets stable, I'll certainly consider using it.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
DaxProxy
Senior Member
Join Date: Sep 2007
Old 04-07-2014 , 18:40   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #27

YamiKaitou, i am sorry if i came out little hostile, it's just that i got really, really annoyed at PAWN, i seriously think that it's one of the worst languages you can code in.

Yeah, i'll look into embedding NodeJS itself (even if it means some kind of hackish method) into your git project tomorrow.
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739

Last edited by DaxProxy; 04-07-2014 at 18:42.
DaxProxy is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 04-07-2014 , 19:09   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #28

Windows support on your beta version would be usefull for coder/testers that doesn't have Linux.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
deejayy
Junior Member
Join Date: Mar 2005
Old 07-08-2015 , 13:33   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #29

Okay, i managed to run io.js (formerly node.js) in hlds, a little sneak peek:

Code:
setInterval(function () {
    hlds.server_printf("helo from node\n");
}, 1000);
Code:
L 07/08/2015 - 17:17:34: helo from node
L 07/08/2015 - 17:17:35: helo from node
stats
CPU   In    Out   Uptime  Users   FPS    Players
 7.00  0.00  0.00       0     0  652.79       0
L 07/08/2015 - 17:17:36: helo from node
L 07/08/2015 - 17:17:37: helo from node
So, ES6 + HLDS on the way.
__________________
deejayy is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-08-2015 , 17:31   Re: HLDS-V8: Extending HLDS with V8 JavaScript engine
Reply With Quote #30

This does sound great, and I like JavaScript as it is more up-to-date language with more features, but I don't think it will ever outperform Pawn in speed and memory usage. That's what concerns me the most. I'm really worried how would JavaScript run big game modes, like Zombie Plague.
klippy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode