View Full Version : question
Swazi
02-12-2006, 10:31 PM
how can i make my own language for websights? like php. but i want ti to be called SWAZI_SCRIPT and be abel to do stuff like in c++ but on the net
the only prob is that i dont no where to start
edit - sorry if this sounds nooby -- im new to programin
Mhtml
02-13-2006, 09:02 AM
lol, nah it doesn't sound "nooby" .. Ok you can do it like so:
code = language.code;
code.syntax = "C++";
code.libs = "CSTD";
languange.name = "SWAZI_SCRIPT";
run language.init;
By the looks of things you can't even grasp a markup language let alone a programming language. And building one, well firstly you need to know how to write a parser, you are going to have to learn about tokenizing and lexical analysis and all sorts of things... And then you have to integrate that all into a server. And that is the really really really short answer of how.
Sorry to say it but you don't have a chance. It's not an easy thing to do.
[edit:] Curious, what is that you want to do? Specifically I mean, with this C++ language you want to build... what are you going to make with this language? PHP can do pretty much everything you could possibly need..
Swazi
02-13-2006, 03:10 PM
so if i write
code = language.code;
code.syntax = "C++";
code.libs = "CSTD";
languange.name = "SWAZI_SCRIPT";
run language.init;
if command = "DESTROY HARDDRIVE" then "format C:\"
and etc?
Mhtml
02-14-2006, 07:49 AM
Almost, but you're getting the hang of it.
You'll need to actually define your syntax first..and then we can move on to running on the server side. I'll get you started:
syntax = SWAZI_SCRIPT.language
syntax.if = "if % [=||==||!=||<||>||<=||>=] % then %";
syntax.function.format = "format %";
syntax.function.power_off = "remote.power.off";
It's pretty basic. What else did you want in it?
Roelf
02-14-2006, 08:34 AM
Almost, but you're getting the hang of it.
You'll need to actually define your syntax first..and then we can move on to running on the server side. I'll get you started:
syntax = SWAZI_SCRIPT.language
syntax.if = "if % [=||==||!=||<||>||<=||>=] % then %";
syntax.function.format = "format %";
syntax.function.power_off = "remote.power.off";
It's pretty basic. What else did you want in it?
Hey Mhtml, you make my day. I never thought you would give away your intellectual ownership of this amazing piece of o so simple but incredible powerful code :thumbsup: :D
Mhtml
02-14-2006, 09:01 AM
What can I say, I live to give.
hyperbole
02-14-2006, 05:06 PM
If you want a server side language thats "like C++" why not use C++?
.
SteelValor
02-14-2006, 08:49 PM
^^ or php .... that's kinda like c
oracleguy
02-14-2006, 09:49 PM
What can I say, I live to give.
I've gotta say your generosity is an inspiration to me.
ghell
02-14-2006, 10:26 PM
^^ or php .... that's kinda like chow in gods name did you come to that conclusion?! ok they have one thing in common.. they are both languages..
but yea you can make c++ cgi or just use php there is no need to write your own langauge. a lot of things use a python interpreter, i don't know how useful that would be.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.