recently i have been written a piece of software, which can sync diaspora stream to hugo blog. hugo is a static site generator. you provide it markdown files, and a theme, and it generates you html/css files.

the main intention was, to get the own tag cloud, and better navigation of all my streams. every post synced from diaspora has a link to the original post on my pod. now it is indeed very pleasurable to see all my history categorized, and i am able to find exact post very easy. yesterday someone asked me about the post from the winter 2014, and it took me a couple of minutes to find it.

the software is written in Oberon, of course. i am trying to write everything, what is possible in Oberon. in order to keep the language alive. and I used my compiler to write it.

So this is the software: I have to make a readme, document it. And I realize that it’s not easy to use it, because first one needs to download an Oberon compiler, in order to compile the program. But I doubt anyone would use it anyway. Also, because in order to use it you have to be a podmin.

so, how does it work? you call

d2h <username>

lets say, I write

d2h norayr

and get markdown files for all my public posts from postgre database. the files look like

i. e. year-month-day_post_id_spyurk,md (spyurk means diaspora in armenian, also that’s my pod name).

But then, I need to update the blog, starting from the last post. No problem!

d2h <username> <last_post_id>

i also added a cron job, which runs a script every night, and syncs diaspora to hugo blog starting from the last post. #diaspora #hugo #blog #migration #sync #cron #oberon #vishap #markdown

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

you use VAR because you want to get the pointer to the array, instead of copying the whole array to the procedure’s stack.

so the suggestion was that if you want to make sure the array won’t be modified, you use “-” mark.

what about optimizations, they say, that in principle compiler can understand that you did not write to the passed array, and instead of passing it to the procedure by value (by copying the whole array), pass it by reference (by copying only pointer to it).

i disagree, because i believe, it is important to mark your intentions. if you intent to make sure you pass it read-only, you pass it with “-”, if you intent to pass it read-write, you pass it just with VAR. passing with ‘OUT’, when you cannot read it, but can only write to it is not supported in Oberon.

@{Antranig Vartanian ;} 01.06.2017, 19:08:27


#oberon #programming #language #design ##

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)