0

In my ample (NOT!) spare time, I'm fiddling with Lhogho and wondering how to go about morphing it into a script engine for web browsers, viz

<h1>My First Web Page</h1>

<script type="text/lhoghoscript">
   print [Hello World]
</script>

</body>
</html> 

Any suggestions where to start? For Windows, I suppose Microsoft Windows Script Interfaces - Introduction. What about Linux and Mac?

On the way there, I'm also trying to figure out how to make Lhogho into a server-side language, rather like PHP or ASP, viz

<head>
<title>Lhogho Preprocessor</title>
</head>
<? print [Hello world] ?>

<body>
</body>
</html>

I figure that'll be slightly easier. Maybe.

Adam Lear
  • 31,939
  • 8
  • 101
  • 125
bugmagnet
  • 415
  • 1
  • 5
  • 13
  • You could have flagged your [SO] question for moderator attention and asked for it to be migrated. In general, cross-posting the same question to multiple sites is frowned upon on the assumption that it should at least be rephrased to fit each site. I'm not sure that your question is more on-topic here than on [SO]. It likely fits better there, since you appear to be asking about performing a task in Lhogho specifically rather than a conceptual question. – Adam Lear Dec 07 '11 at 04:25
  • Righto then, I'll flag some attention and get it pulled off SO. Thanks for your patience. – bugmagnet Dec 07 '11 at 05:46

1 Answers1

1

I would suggest writing a Javascript Lhogho interpreter or a compiler to Javascript for embedding in browsers- processing.js or Dart use these strategies to get their language into browsers.

For instance, if you implement a Lhogho compiler using LLVM, you can use emscripten to turn LLVM bytecode into Javascript. Thus, you could write a preprocessor that turned Lhogho -> LLVM bytecode -> Javascript.

For server-side stuff, you are right, it's easier. You might start with CGI ( http://en.wikipedia.org/wiki/Common_Gateway_Interface ). CGI describes how a web server can invoke an external program to generate server-side content. If Lhogho programs can be invoked as external programs, you could do server-side Lhogho programming without much effort, and research how to make it "nicer" (raw CGI is pretty uncomfortable). Alternatively, you might want to try FastCGI ( http://en.wikipedia.org/wiki/FastCGI ), which offers better performance.

alex
  • 2,904
  • 1
  • 15
  • 19