Would it make sense to try to rewrite ceylon-lang.org in Ceylon?

134 views
Skip to first unread message

Colin Bartolome

unread,
Mar 23, 2017, 2:10:56 PM3/23/17
to ceylon-users
Hi everybody,

I've been messing with a proof of concept here:

https://github.com/CPColin/ceylon-lang.org

Basically, the idea is to take the code for ceylon-lang.org and rewrite it in Ceylon, to eliminate the dependency on Awestruct and to demonstrate a couple of important Herd modules. The content served by ceylon-lang.org would either be generated on the fly (by a running server process) or ahead of time (by a "generate" step in the release procedure). Granted, the current site works perfectly fine and its architecture probably doesn't currently hinder anybody from fixing typos they encounter, so the question here is whether the end result would be nice to have or not.

Pros:
  • We would gain a real-world example of the ceylon.html and ceylon.http.server modules.
  • Developers would be able to run the website without installing external dependencies. We could even have the bootstrap script start up the server, making it even easier to get the site up and running locally.
  • We should be able to serve existing .md files without modification by using the ceylon.markdown module. (So we wouldn't need to convert all the old blog posts and documentation.)
  • We could replace the logic in .haml files with Ceylon code, removing the need to know HAML, YAML, and Ruby.
  • Any pain points we find during development could loop back around and become feature requests or bug reports for the modules in question.
Cons:
  • The ceylon.markdown module is not yet in the Herd and, thus, still counts as an external dependency, for the time being.
  • The Markdown processor currently in use produces different output than the latest version of the ceylon.markdown module does, suggesting that we may need to review the new layout of existing pages. (So we might need to update all the old blog posts and documentation after all.)
  • We'd need to replace the SCSS functionality or rewrite the CSS so it no longer needs it. The jsass library depends on the native libsass library, so we can't use that.
  • The current host for the ceylon-lang.org domain may not be configured (or able) to run a Ceylon server process.

What does everybody think? Would the resulting site, written in Ceylon, be beneficial? Is it even possible (or wise) to configure the existing server to run a Ceylon server process?

Tako Schotanus

unread,
Mar 23, 2017, 3:07:39 PM3/23/17
to ceylon-users
That would certainly be interesting Colin. It certainly would be good dogfooding.

The reason for the current system is that it generates static HTML, so it would be able to stand up to lots of traffic.
So if a replacement written in Ceylon could do that too it would certainly be an advantage.
Now, realistically we've never been slashdotted so I'm not sure if we couldn't just have an actual server component.
Or perhaps a combination where certain paths (like root, the docs, etc) get served by Apache (or whatever it is that currently serves the static HTML pages) and certain other paths get redirected to a Ceylon server component.
I'm also positive that any layout problems we might encounter are solvable.

So the real problem, at least for us? Time. With so much to do and so little time on our hands it's just not something the core team sees as being urgent, regardless of how much we'd like to see our website being run/generated by Ceylon code. But I'm sure we'd welcome any effort from the community to do this ;-)

Cheers,
-Tako (speaking for himself, not for the whole team)



--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/c87e574b-ebe0-4344-a5a5-ebca4508edd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephane Epardaud

unread,
Mar 23, 2017, 3:34:25 PM3/23/17
to ceylon...@googlegroups.com
Wow that's pretty neat! I'd really love to remove the awestruct dependency, but yeah, we'd still have to generate static HTML. As for ceylon.markdown, we should really make sure it goes in Herd.


For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud

Roland Tepp

unread,
Mar 27, 2017, 4:07:10 AM3/27/17
to ceylon-users
Yes

I see no Cons to this proposal.

The only regret is that core team is too busy working on ... well, core language and tooling, to deal with this rewrite, but I do wholeheartedly support this proposal.

I am sure whatever roadblocks we have, we can overcome these with loads of cooperation from the core team.

Roland

Colin Bartolome

unread,
Mar 28, 2017, 3:12:26 PM3/28/17
to ceylon-users
Thanks, everybody. I'll keep plugging away at it and see what comes out of it.

Colin Bartolome

unread,
Apr 28, 2017, 2:48:52 PM4/28/17
to ceylon-users
I finally updated the readme to say how to run the Ceylon version of the website, by the way:

https://github.com/CPColin/ceylon-lang.org#port-from-awestruct-to-ceylon

It's progressing! I'd call it about 40% functional, but it needs a bunch more polish before it's something useful.

Tako Schotanus

unread,
Apr 28, 2017, 4:33:28 PM4/28/17
to ceylon-users
Hi Colin,

I want to try it out but I'm getting:

$ ceylon compile org.ceylonlang
source/org/ceylonlang/pages/Page.ceylon:16: error: imported declaration not found: 'textContent' might be misspelled or does not belong to this package
    textContent
    ^
source/org/ceylonlang/pages/Page.ceylon:126: error: argument must be assignable to parameter 'replacement' of 'replaceAll': 'String(MatchResult)' is not assignable to 'String(String)'
        return replaceAll(regex, markdown, replacement);
                                           ^
source/org/ceylonlang/pages/Page.ceylon:146: error: no matching parameter for named argument 'defaultLanguage' declared by 'RenderOptions'
            defaultLanguage = "ceylon";
            ^
source/org/ceylonlang/pages/Page.ceylon:147: error: no matching parameter for named argument 'linkHeadings' declared by 'RenderOptions'
            linkHeadings = linkHeadings;
            ^
source/org/ceylonlang/pages/Page.ceylon:169: warning: declaration is deprecated: 'parseBoolean' is annotated 'deprecated' in 'ceylon.language' '"1.3.2"'
            then parseBoolean(gitHubEditableProperty)
                 ^
source/org/ceylonlang/pages/Page.ceylon:172: warning: declaration is deprecated: 'parseInteger' is annotated 'deprecated' in 'ceylon.language' '"1.3.2"'
    shared Integer level => parseInteger(property(keyLevel) else "") else 0;
                            ^
source/org/ceylonlang/pages/Page.ceylon:174: error: function or value is not defined: 'textContent' might be misspelled or is not imported (did you mean 'tableOfContents'?)
    value markdownTitle => textContent(Parser().parse(property(keyTitleMarkdown) else ""));
                           ^
source/org/ceylonlang/pages/Page.ceylon:182: error: could not determine type of function or value reference: 'markdownTitle'
    shared String title => property(keyTitle) else markdownTitle;
                                                   ^
source/org/ceylonlang/pages/downloadArchivePage.ceylon:31: warning: declaration is deprecated: 'formatFloat' is annotated 'deprecated' in 'ceylon.language' '"1.3.2"'
        => formatFloat { // TODO Using Float.format caused a backend error.
           ^
6 errors
3 warnings

Any idea what might be wrong?




-Tako

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.

Colin Bartolome

unread,
Apr 28, 2017, 6:16:28 PM4/28/17
to ceylon-users, ta...@codejive.org
That looks like an issue with the branch of ceylon.markdown you have. It should be this one, to pick up the extensions I had to make to support the website:

https://github.com/CPColin/ceylon.markdown/tree/ceylon-lang


-Tako

To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.

To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.

Tako Schotanus

unread,
Apr 28, 2017, 6:39:41 PM4/28/17
to Colin Bartolome, ceylon-users
Ah yes, now that I reread the docs I see it says:

    This project requires the ceylon.markdown.directport module from my CPColin/ceylon.markdown/ceylon-lang branch.

And the word "directport" stuck in my mind so when I saw a branch with that name I thought "that's the one" ;)

Let me try again...


-Tako

Tako Schotanus

unread,
Apr 28, 2017, 6:44:13 PM4/28/17
to Colin Bartolome, ceylon-users
Seems to work just fine. Great work! :)


-Tako

paper1111

unread,
May 10, 2017, 5:03:19 AM5/10/17
to ceylon-users
Great idea! It can serve as an example for new Ceylon programmers (like me) on how to create websites using Ceylon!

PS. I don't seem to find any tutorials on creating sites with Ceylon...

Reply all
Reply to author
Forward
0 new messages