Run Reia module on top of YAWS
Reported by Philipp Pirozhkov | November 6th, 2008 @ 01:20 AM
Since we need to have support for web applications, it's a good idea to use a mature web servers, one of which is YAWS. So it would be nice to be able to run such a module in YAWS: module A def out(a)
(~html, "Hello, World!")
with minimal Reia changes and YAWS configuration
Comments and changes to this ticket
-
Philipp Pirozhkov November 6th, 2008 @ 01:34 AM
I've tried to do so, but ran into two issues: 1. Erlang doesn't want to load modules with Capitalized module name (not file name!). 2. Reia outputs data with type declaration attached, so instead of: {html, "Hello, World"} we are getting {tuple, {html, {string, "Hello,World"}}}
I've changed parser so that all module names are compiled to be lower-case in .beam files. But that breaks dispatcher and tests (and even ire itself), so that all that stuff should be changed to use lower-case module names. secondly i've patched reia_string (moved its functionality to reia_list), Tuple, reia_dispatcher to remove type declarations. both are bad ideas, uh?
Tony suggested to use a simple shim between Reia appmod and YAWS: -module(my_shim). -export([out/1])
out(Arg) -> reia_erl:r2e('A':out(reia_erl:e2r(Arg)).
This seems to solve both issues.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Reia a dynamic scripting language for the Erlang virtual machine (BEAM)