{"@attributes":{"version":"2.0"},"channel":{"title":"DEV Community: J\u00e9r\u00e9mie Astor","description":"The latest articles on DEV Community by J\u00e9r\u00e9mie Astor (@fennecdjay).","link":"https:\/\/dev.to\/fennecdjay","image":{"url":"https:\/\/media2.dev.to\/dynamic\/image\/width=90,height=90,fit=cover,gravity=auto\/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F213839%2Fd716c28d-927b-4782-85be-42d3682e5451.gif","title":"DEV Community: J\u00e9r\u00e9mie Astor","link":"https:\/\/dev.to\/fennecdjay"},"language":"en","item":[{"title":"Gwion changes home! (aka growing from hacktoberfest)","pubDate":"Sun, 18 Oct 2020 19:53:21 +0000","link":"https:\/\/dev.to\/gwion\/gwion-changes-home-aka-growing-from-hacktoberfest-36j8","guid":"https:\/\/dev.to\/gwion\/gwion-changes-home-aka-growing-from-hacktoberfest-36j8","description":"<p>A few years ago, I started writing a programming language to help me in various musical tasks: I loved <a href=\"http:\/\/chuck.stanford.edu\/\">chuck<\/a> so much, but I came to a point where it was not that <em>usable<\/em> in terms of performance, so I decided to make my own.<\/p>\n\n<p>It was a great opportunity to learn about more programming and to add a few feature if missed (sometimes badly) in chuck: things like function pointers and generics, to start with.<\/p>\n\n<p>It all finally came to the point where a <a href=\"https:\/\/github.com\/orgs\/Gwion\/teams\/main\">team<\/a> built and, Hacktoberfest helping, I had to move all that work on the <a href=\"https:\/\/github.com\/Gwion\">organization<\/a> account.<\/p>\n\n<p>In the end, I think and hope it'll help <a href=\"https:\/\/github.com\/Gwion\/Gwion\">this project<\/a> grow, become more and more usable and build its community.<\/p>\n\n\n\n\n<p>Don't forget is still hacktoberfest, and you can contribute this project! A summary on all issues can be found <a href=\"https:\/\/github.com\/Gwion\/Gwion\/issues\/195\">here<\/a>.<\/p>\n\n<p>If you are interrested in participating in Gwion's developement project, please comment <a href=\"https:\/\/github.com\/Gwion\/Gwion\/issues\/180\">here<\/a>, we will be happy to invite you.<\/p>\n\n","category":["showdev","hacktoberfest","proglangdesign","gwion"]},{"title":"Hello, Gwion!","pubDate":"Mon, 28 Sep 2020 16:00:53 +0000","link":"https:\/\/dev.to\/fennecdjay\/hello-gwion-6hm","guid":"https:\/\/dev.to\/fennecdjay\/hello-gwion-6hm","description":"<h1>\n  \n  \n  Hello, Gwion!\n<\/h1>\n\n<p>I've been posting about <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\">Gwion<\/a> here for a while, but never explaining quite clearly what the project could do.<br>\nI'm hoping this post while help people have an idea of that.<br>\nAt the end of this tutorial, you should be able to hear sound generated by Gwion in your browser \ud83d\ude04<\/p>\n<h3>\n  \n  \n  Dependencies\n<\/h3>\n\n<p>Please make sure all these are installed on your computer:<\/p>\n\n<ul>\n<li>A C compiler.\nGwion is tested with <a href=\"https:\/\/gcc.gnu.org\/\">gcc<\/a> and <a href=\"https:\/\/clang.llvm.org\">clang<\/a>\n<\/li>\n<li><a href=\"https:\/\/www.gnu.org\/software\/make\/\">make<\/a><\/li>\n<li>a terminal emulator. (I use <a href=\"https:\/\/sw.kovidgoyal.net\/kitty\/\">kitty<\/a>)<\/li>\n<li><a href=\"https:\/\/libwebsockets.org\/\">libwebsockets<\/a><\/li>\n<li>Soundpipe. The original repo has been removed, but you can still find copy on github.\nYou can try <a href=\"https:\/\/github.com\/shybyte\/soundpipe\">this one<\/a>\n<\/li>\n<\/ul>\n\n<p>Now you're all set, let me suggest you first follow instructions in<br>\n<a href=\"https:\/\/dev.to\/fennecdjay\/building-a-project-from-markdown-57gf\">this short post<\/a> and get back reading here, it'll save you most of the burden (as in just read \ud83d\ude04)<\/p>\n<h2>\n  \n  \n  Gwion\n<\/h2>\n\n<p>First we need to get gwion, we'll follow the basic procedure,<br>\nbut we will also need some plugins, so we add <code>plug<\/code> to the <code>submodule update<\/code> command<\/p>\n\n<blockquote>\n<p>install_gwion.sh<br>\n<\/p>\n\n\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight shell\"><code>git clone https:\/\/github.com\/fennecdjay\/Gwion\n<span class=\"nb\">cd <\/span>Gwion\ngit submodule update <span class=\"nt\">--init<\/span> util ast plug\nmake\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h3>\n  \n  \n  Building the plugins\n<\/h3>\n\n<p>For this project we need a few plugins.<br><br>\nLet's build them too.<\/p>\n\n<blockquote>\n<p>plugins.sh<br>\n<\/p>\n\n\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight shell\"><code><span class=\"nb\">cd <\/span>Gwion\/plug\/Soundpipe\nmake\n<span class=\"nb\">cd<\/span> ..\/Modules\nmake\n<span class=\"nb\">cd<\/span> ..\/WebSocket\nmake\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h2>\n  \n  \n  The browser part\n<\/h2>\n\n<p>Now, since the goal is to hear Gwion's audio output from the browser,<br>\nwe'll need some javascript and html<\/p>\n\n<blockquote>\n<p>gwion_ws_test.js<br>\n<\/p>\n\n\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight javascript\"><code><span class=\"kd\">const<\/span> <span class=\"nx\">URL<\/span> <span class=\"o\">=<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">ws:\/\/localhost:1111<\/span><span class=\"dl\">\"<\/span>\n<span class=\"kd\">const<\/span> <span class=\"nx\">BUFLEN<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">512<\/span><span class=\"p\">;<\/span>\n<span class=\"kd\">const<\/span> <span class=\"nx\">NCHAN<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">2<\/span><span class=\"p\">;<\/span>\n<span class=\"kd\">var<\/span> <span class=\"nx\">ws<\/span><span class=\"p\">;<\/span>\n<span class=\"kd\">var<\/span> <span class=\"nx\">scriptNode<\/span><span class=\"p\">;<\/span>\n<span class=\"kd\">var<\/span> <span class=\"nx\">audioCtx<\/span><span class=\"p\">;<\/span>\n<span class=\"kd\">var<\/span> <span class=\"nx\">outsamples<\/span> <span class=\"o\">=<\/span> <span class=\"k\">new<\/span> <span class=\"nb\">Float32Array<\/span><span class=\"p\">(<\/span><span class=\"nx\">BUFLEN<\/span><span class=\"p\">);<\/span>\n<span class=\"kd\">var<\/span> <span class=\"nx\">volume<\/span> <span class=\"o\">=<\/span> <span class=\"mf\">0.5<\/span><span class=\"p\">;<\/span>\n\n<span class=\"kd\">function<\/span> <span class=\"nx\">gwionWsSetVolume<\/span><span class=\"p\">(<\/span><span class=\"nx\">value<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n  <span class=\"nx\">volume<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">value<\/span><span class=\"p\">;<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"kd\">function<\/span> <span class=\"nx\">gwionWsFillBuffer<\/span><span class=\"p\">(<\/span><span class=\"nx\">audioProcessingEvent<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n  <span class=\"nx\">ws<\/span><span class=\"p\">.<\/span><span class=\"nx\">send<\/span><span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">next<\/span><span class=\"dl\">\"<\/span><span class=\"p\">);<\/span>\n  <span class=\"kd\">var<\/span> <span class=\"nx\">outputBuffer<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">audioProcessingEvent<\/span><span class=\"p\">.<\/span><span class=\"nx\">outputBuffer<\/span><span class=\"p\">;<\/span>\n  <span class=\"k\">for<\/span> <span class=\"p\">(<\/span><span class=\"kd\">var<\/span> <span class=\"nx\">channel<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">0<\/span><span class=\"p\">;<\/span> <span class=\"nx\">channel<\/span> <span class=\"o\">&lt;<\/span> <span class=\"nx\">NCHAN<\/span><span class=\"p\">;<\/span> <span class=\"nx\">channel<\/span><span class=\"o\">++<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n    <span class=\"kd\">var<\/span> <span class=\"nx\">outputData<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">outputBuffer<\/span><span class=\"p\">.<\/span><span class=\"nx\">getChannelData<\/span><span class=\"p\">(<\/span><span class=\"nx\">channel<\/span><span class=\"p\">);<\/span>\n    <span class=\"k\">for<\/span> <span class=\"p\">(<\/span><span class=\"kd\">var<\/span> <span class=\"nx\">sample<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">0<\/span><span class=\"p\">;<\/span> <span class=\"nx\">sample<\/span> <span class=\"o\">&lt;<\/span> <span class=\"nx\">BUFLEN<\/span><span class=\"p\">;<\/span> <span class=\"nx\">sample<\/span><span class=\"o\">++<\/span><span class=\"p\">)<\/span>\n      <span class=\"nx\">outputData<\/span><span class=\"p\">[<\/span><span class=\"nx\">sample<\/span><span class=\"p\">]<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">outsamples<\/span><span class=\"p\">[<\/span><span class=\"nx\">sample<\/span> <span class=\"o\">+<\/span> <span class=\"nx\">channel<\/span><span class=\"o\">*<\/span><span class=\"nx\">BUFLEN<\/span><span class=\"p\">]<\/span> <span class=\"o\">*<\/span> <span class=\"nx\">volume<\/span><span class=\"p\">;<\/span>\n  <span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"kd\">function<\/span> <span class=\"nx\">gwionWsOnOpen<\/span><span class=\"p\">()<\/span>  <span class=\"p\">{<\/span>\n  <span class=\"nx\">audioCtx<\/span> <span class=\"o\">=<\/span> <span class=\"k\">new<\/span> <span class=\"p\">(<\/span><span class=\"nb\">window<\/span><span class=\"p\">.<\/span><span class=\"nx\">AudioContext<\/span> <span class=\"o\">||<\/span> <span class=\"nb\">window<\/span><span class=\"p\">.<\/span><span class=\"nx\">webkitAudioContext<\/span><span class=\"p\">)();<\/span>\n  <span class=\"nx\">console<\/span><span class=\"p\">.<\/span><span class=\"nx\">log<\/span><span class=\"p\">(<\/span><span class=\"nx\">audioCtx<\/span><span class=\"p\">.<\/span><span class=\"nx\">sampleRate<\/span><span class=\"p\">);<\/span>\n  <span class=\"nx\">scriptNode<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">audioCtx<\/span><span class=\"p\">.<\/span><span class=\"nx\">createScriptProcessor<\/span><span class=\"p\">(<\/span><span class=\"nx\">BUFLEN<\/span><span class=\"p\">,<\/span> <span class=\"nx\">NCHAN<\/span><span class=\"p\">,<\/span> <span class=\"nx\">NCHAN<\/span><span class=\"p\">);<\/span>\n  <span class=\"nx\">scriptNode<\/span><span class=\"p\">.<\/span><span class=\"nx\">onaudioprocess<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">gwionWsFillBuffer<\/span><span class=\"p\">;<\/span>\n  <span class=\"nx\">scriptNode<\/span><span class=\"p\">.<\/span><span class=\"nx\">connect<\/span><span class=\"p\">(<\/span><span class=\"nx\">audioCtx<\/span><span class=\"p\">.<\/span><span class=\"nx\">destination<\/span><span class=\"p\">);<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"kd\">function<\/span> <span class=\"nx\">gwionWsOnMessage<\/span><span class=\"p\">(<\/span><span class=\"nx\">e<\/span><span class=\"p\">)<\/span>  <span class=\"p\">{<\/span>\n<span class=\"c1\">\/\/  if(e.data instanceof ArrayBuffer)<\/span>\n  <span class=\"nx\">outsamples<\/span> <span class=\"o\">=<\/span> <span class=\"k\">new<\/span> <span class=\"nb\">Float32Array<\/span><span class=\"p\">(<\/span><span class=\"nx\">e<\/span><span class=\"p\">.<\/span><span class=\"nx\">data<\/span><span class=\"p\">);<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"kd\">function<\/span> <span class=\"nx\">gwionWsOnClose<\/span><span class=\"p\">()<\/span>  <span class=\"p\">{<\/span>\n  <span class=\"k\">if<\/span><span class=\"p\">(<\/span><span class=\"nx\">audioCtx<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n    <span class=\"nx\">scriptNode<\/span><span class=\"p\">.<\/span><span class=\"nx\">disconnect<\/span><span class=\"p\">();<\/span>\n    <span class=\"nx\">audioCtx<\/span><span class=\"p\">.<\/span><span class=\"nx\">close<\/span><span class=\"p\">();<\/span>\n    <span class=\"nx\">alert<\/span><span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">Connection closed<\/span><span class=\"dl\">\"<\/span><span class=\"p\">);<\/span>\n  <span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"kd\">function<\/span> <span class=\"nx\">gwionWsInit<\/span><span class=\"p\">()<\/span> <span class=\"p\">{<\/span>\n  <span class=\"nx\">ws<\/span> <span class=\"o\">=<\/span> <span class=\"k\">new<\/span> <span class=\"nx\">WebSocket<\/span><span class=\"p\">(<\/span><span class=\"nx\">URL<\/span><span class=\"p\">);<\/span>\n  <span class=\"k\">if<\/span><span class=\"p\">(<\/span><span class=\"o\">!<\/span><span class=\"nx\">ws<\/span><span class=\"p\">)<\/span>\n    <span class=\"nx\">alert<\/span><span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">Web socket server not found at url: <\/span><span class=\"dl\">\"<\/span> <span class=\"o\">+<\/span> <span class=\"nx\">URL<\/span><span class=\"p\">);<\/span>\n  <span class=\"nx\">ws<\/span><span class=\"p\">.<\/span><span class=\"nx\">onopen<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">gwionWsOnOpen<\/span><span class=\"p\">;<\/span>\n  <span class=\"nx\">ws<\/span><span class=\"p\">.<\/span><span class=\"nx\">onmessage<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">gwionWsOnMessage<\/span><span class=\"p\">;<\/span>\n  <span class=\"nx\">ws<\/span><span class=\"p\">.<\/span><span class=\"nx\">onclose<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">gwionWsOnClose<\/span><span class=\"p\">;<\/span>\n  <span class=\"nx\">ws<\/span><span class=\"p\">.<\/span><span class=\"nx\">binaryType<\/span> <span class=\"o\">=<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">arraybuffer<\/span><span class=\"dl\">\"<\/span><span class=\"p\">;<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"kd\">function<\/span> <span class=\"nx\">gwionWsOnLoad<\/span><span class=\"p\">()<\/span> <span class=\"p\">{<\/span>\n  <span class=\"k\">if<\/span> <span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">WebSocket<\/span><span class=\"dl\">\"<\/span> <span class=\"k\">in<\/span> <span class=\"nb\">window<\/span><span class=\"p\">)<\/span>\n    <span class=\"nx\">gwionWsInit<\/span><span class=\"p\">();<\/span>\n  <span class=\"k\">else<\/span>\n    <span class=\"nx\">alert<\/span><span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">WebSocket NOT supported by your Browser!<\/span><span class=\"dl\">\"<\/span><span class=\"p\">);<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<blockquote>\n<p>gwion_ws_test.html<br>\n<\/p>\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight html\"><code><span class=\"cp\">&lt;!DOCTYPE HTML&gt;<\/span>\n<span class=\"nt\">&lt;html&gt;<\/span>\n  <span class=\"nt\">&lt;script <\/span><span class=\"na\">src=<\/span><span class=\"s\">\"gwion_ws_test.js\"<\/span><span class=\"nt\">&gt;&lt;\/script&gt;<\/span>\n  <span class=\"nt\">&lt;body&gt;<\/span>\n  <span class=\"nt\">&lt;p&gt;&lt;button<\/span> <span class=\"na\">onclick=<\/span><span class=\"s\">\"gwionWsOnLoad();\"<\/span><span class=\"nt\">&gt;<\/span>Connect<span class=\"nt\">&lt;\/button&gt;&lt;p&gt;<\/span>\n  <span class=\"nt\">&lt;p&gt;&lt;input<\/span> <span class=\"na\">id=<\/span><span class=\"s\">\"volumeSlider\"<\/span> <span class=\"na\">type=<\/span><span class=\"s\">\"range\"<\/span> <span class=\"na\">min=<\/span><span class=\"s\">\"0\"<\/span> <span class=\"na\">max=<\/span><span class=\"s\">\"1\"<\/span> <span class=\"na\">value=<\/span><span class=\"s\">\"0.5\"<\/span> <span class=\"na\">step=<\/span><span class=\"s\">\"0.01\"<\/span> <span class=\"na\">oninput<\/span><span class=\"nt\">&gt;<\/span>\n  <span class=\"nt\">&lt;\/body&gt;<\/span>\n<span class=\"nt\">&lt;\/html&gt;<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h3>\n  \n  \n  Contributing\n<\/h3>\n\n<p>You quite probably have a better knowledge of javascript than me.<br>\nFeel free to share your improvements and submit a PR.<br>\nUsing Web assembly and switching from ScriptProcessor to AudioWorklet<br>\nwould be great additions!<\/p>\n<h2>\n  \n  \n  Some life-easing script\n<\/h2>\n\n<p>Now we got all the pieces.<br><br>\nWe just need to assemble all this.<\/p>\n\n<blockquote>\n<p>ease.sh<br>\n<\/p>\n\n\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight shell\"><code><span class=\"c\"># create a 'libs' directory to store our plugins<\/span>\n<span class=\"nb\">mkdir <\/span>libs\n<span class=\"c\"># copy all the plugins we built into 'libs'<\/span>\n<span class=\"nb\">cp <\/span>Gwion\/plug\/<span class=\"k\">*<\/span>\/<span class=\"k\">*<\/span>.so libs\n<span class=\"c\"># '-s 44100' as most browsers will output sound at that samplerate<\/span>\n<span class=\"c\"># '-p libs' tell gwion where to look for plugins<\/span>\n<span class=\"c\"># '-d ws' use 'ws' (aka WebSocket) driver<\/span>\n<span class=\"c\"># '$@' pass all arguments to gwion<\/span>\n<span class=\"nb\">echo<\/span> <span class=\"s1\">'.\/Gwion\/gwion -s 44100 -p libs -d ws $@'<\/span> <span class=\"o\">&gt;<\/span> run.sh\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h2>\n  \n  \n  A sound synthesis Hello World\n<\/h2>\n\n<p>The sound synthesis equivalent of <em>hello world<\/em> seems to be 5 seconds of a sine generator, at 440 hertz.<br><br>\nLet's just do that.<\/p>\n\n<blockquote>\n<p>hello_sine.gw<br>\n<\/p>\n\n\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight cpp\"><code><span class=\"cp\">#! Create a Sine generator and connect it to audio output\n<\/span><span class=\"n\">var<\/span> <span class=\"n\">SinOsc<\/span> <span class=\"n\">s<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"n\">dac<\/span><span class=\"p\">;<\/span>\n<span class=\"cp\">#! let five seconds pass\n<\/span><span class=\"mi\">5<\/span><span class=\"o\">::<\/span><span class=\"n\">second<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"n\">now<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<blockquote>\n<p>test.sh<br>\n<\/p>\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight shell\"><code><span class=\"c\"># do nothing without a BROWSER variable<\/span>\n<span class=\"k\">if<\/span> <span class=\"o\">[<\/span> <span class=\"nt\">-z<\/span> <span class=\"s2\">\"<\/span><span class=\"nv\">$BROWSER<\/span><span class=\"s2\">\"<\/span> <span class=\"o\">]<\/span>\n<span class=\"k\">then\n  <\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">\"please set BROWSER environment variable\"<\/span>\n  <span class=\"nb\">exit <\/span>1\n<span class=\"k\">done<\/span>\n<span class=\"nv\">$BROWSER<\/span> gwion_ws_test.html &amp;!\nbash run.sh hello_sine.gw\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>You might now see the test page in your browser.<br>\nClick the <code>Connect<\/code> button and you might here something! \ud83c\udf7e<\/p>\n\n<h2>\n  \n  \n  More to come\n<\/h2>\n\n<p>Hopefully this post will get some support, and it'll motivate me to continue.<br>\nI think the second episode will demonstrate a simple but interesting psycho-acoustic experience,<br>\nand the third should show how to build a simple melody.<br>\nSince Gwion can obviously do so much more, there might be a ton of follow-up articles \ud83d\ude04<\/p>\n\n","category":["showdev","proglangdesign","beginners"]},{"title":"Building a project from markdown","pubDate":"Sun, 27 Sep 2020 18:08:04 +0000","link":"https:\/\/dev.to\/fennecdjay\/building-a-project-from-markdown-57gf","guid":"https:\/\/dev.to\/fennecdjay\/building-a-project-from-markdown-57gf","description":"<h1>\n  \n  \n  Building a project from markdown\n<\/h1>\n\n<p>This post is intented as an helper for my next one \ud83d\ude04<\/p>\n\n<p>It aims to briefly demonstrate how one can use <a href=\"https:\/\/github.com\/fennecdjay\/mdr\">mdr<\/a><br>\nto build a project from a mdr file, which happens to be a markdown file<br>\nwith few annotations.<\/p>\n\n<p>Since I not yet comfortable with technical nor post writing,<br>\nI'm leaving a (hopefully commented) script do the explanation.<br>\nPlease read before running \ud83d\ude04<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight shell\"><code><span class=\"c\"># create a new directory and cd into it<\/span>\n<span class=\"nb\">mkdir <\/span>GwionTest\n<span class=\"nb\">cd <\/span>GwionTest\n\n<span class=\"c\"># clone, build and install mdr<\/span>\ngit clone https:\/\/github.com\/fennecdjay\/mdr\n<span class=\"nb\">cd <\/span>mdr\nmake\n<span class=\"nb\">sudo <\/span>make <span class=\"nb\">install<\/span>\n\n<span class=\"c\"># get back to GwionTest directory<\/span>\n<span class=\"nb\">cd<\/span> ..\n\n<span class=\"c\"># get the mdr file<\/span>\ncurl https:\/\/raw.githubusercontent.com\/fennecdjay\/devto.sh\/master\/mdr\/HelloGwion.mdr <span class=\"nt\">-o<\/span> HelloGwion.mdr\n\n<span class=\"c\"># run mdr on the file, thus building the project<\/span>\n<span class=\"c\"># set the BROWSER variable to the executable of the browser you use<\/span>\n<span class=\"c\"># e.g: BROWSER=dissenter-browser mdr HelloGwion.mdr<\/span>\n<span class=\"nv\">BROWSER<\/span><span class=\"o\">=<\/span>&lt;your browser here&gt; mdr HelloGwion.mdr\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>I you see any issues with the wording or anything in this post or the mdr file,<br>\nplease let me know.<\/p>\n\n","category":"showdev"},{"title":"How do you make banners for your posts? ","pubDate":"Sun, 27 Sep 2020 17:52:12 +0000","link":"https:\/\/dev.to\/fennecdjay\/how-do-you-make-banners-for-your-posts-2d00","guid":"https:\/\/dev.to\/fennecdjay\/how-do-you-make-banners-for-your-posts-2d00","description":"<p>For this one and my next post I'm using <a href=\"https:\/\/christopherkade.com\/banner-generator\/\">this<\/a>, thanks to a fellow DEV member, but last time I tried to do <a href=\"https:\/\/dev.to\/fennecdjay\/github-discussions-in-your-terminal-4cbd\">one<\/a> myself, I got bad reviews (which were all pretty sensible).<\/p>\n\n<p>I'd like to be able to have <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\">Gwion<\/a>'s <a href=\"https:\/\/gist.githubusercontent.com\/fennecdjay\/44d29b1c18b043e5a1d56a958e4ee524\/raw\/f85343677357b690e579f7c9f87f7efd3368d4d8\/gwion-logo.svg\">logo<\/a> and add text to it programmatically. Any idea how do that?<\/p>\n\n<p>More important, what do you use?<\/p>\n\n\n\n\n<p>EDIT: Changed the (missing) banner for one I made using canva.com, according to the suggestions.<br>\nThe site is very usable, but doesn't seem to have an API, so I might change at one point.<\/p>\n\n","category":["help","watercooler","discuss"]},{"title":"How can I make my posts more discoverable? ","pubDate":"Wed, 16 Sep 2020 16:37:56 +0000","link":"https:\/\/dev.to\/fennecdjay\/how-can-i-make-my-posts-more-discoverable-59ed","guid":"https:\/\/dev.to\/fennecdjay\/how-can-i-make-my-posts-more-discoverable-59ed","description":"<p>I'm asking this because my <a href=\"https:\/\/dev.to\/fennecdjay\/github-discussions-in-your-terminal-4cbd\">last post<\/a> reached almost nobody. While most of the stuff I've been writing here is obviously low quality, I feel this particular post deserves some interest, and to be honest, I'm eager to get some feedback on this work.<\/p>\n\n<p><span>Photo by <a href=\"https:\/\/unsplash.com\/@isaacdavis?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Isaac Davis<\/a> on <a href=\"https:\/\/unsplash.com\/s\/photos\/discovery?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Unsplash<\/a><\/span><\/p>\n\n","category":["help","discuss"]},{"title":"A new syntax for Gwion!","pubDate":"Wed, 16 Sep 2020 11:22:39 +0000","link":"https:\/\/dev.to\/fennecdjay\/github-discussions-in-your-terminal-4cbd","guid":"https:\/\/dev.to\/fennecdjay\/github-discussions-in-your-terminal-4cbd","description":"<h1>\n  \n  \n  Syntax changes for Gwion\n<\/h1>\n\n<blockquote>\n<p>Check it <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\/tree\/NewSyntax\">here<\/a><\/p>\n<\/blockquote>\n\n<p>I tried to address the syntax problems in Gwion.<br>\nHere's what I changed:<\/p>\n<h2>\n  \n  \n  Declaration\n<\/h2>\n\n<p>Declarations needs a prefix<\/p>\n\n<ul>\n<li><code>var<\/code><\/li>\n<li><code>ref<\/code><\/li>\n<li><code>nonnull<\/code><\/li>\n<li><code>const<\/code><\/li>\n<li><code>nonnull ref<\/code><\/li>\n<li><code>const ref<\/code><\/li>\n<li><code>const nonnull<\/code><\/li>\n<li><code>const nonnull ref<\/code><\/li>\n<\/ul>\n\n<p>This fixes the ambiguity of placement between <code>const<\/code>, <code>nonnull<\/code> and <code>ref<\/code> and makes it easy both for the reader and the parser to know when a variable is declared.<\/p>\n\n<p>Also, there is no longer a need to use <code>-&gt;<\/code> when declaring member types.<\/p>\n\n<blockquote>\n<p>old syntax<br>\n<\/p>\n\n\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight cpp\"><code><span class=\"k\">class<\/span> <span class=\"nc\">C<\/span> <span class=\"p\">{<\/span>\n  <span class=\"k\">class<\/span> <span class=\"nc\">D<\/span> <span class=\"p\">{}<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"n\">C<\/span><span class=\"o\">-&gt;<\/span><span class=\"n\">D<\/span> <span class=\"n\">d<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<blockquote>\n<p>new syntax<br>\n<\/p>\n<\/blockquote>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight cpp\"><code><span class=\"k\">class<\/span> <span class=\"nc\">C<\/span> <span class=\"p\">{<\/span>\n  <span class=\"k\">class<\/span> <span class=\"nc\">D<\/span> <span class=\"p\">{}<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"cp\">#! with the new 'var' modifier\n<\/span><span class=\"n\">var<\/span> <span class=\"n\">C<\/span><span class=\"p\">.<\/span><span class=\"n\">D<\/span> <span class=\"n\">d<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h2>\n  \n  \n  Acces Specifier\n<\/h2>\n\n<p>Attained consistency in placement.<br>\nNow it is always:<br>\n  <code>static<\/code> or <code>global<\/code> or nothing<br>\n  followed by<br>\n  <code>private<\/code> or <code>protect<\/code> or nothing<\/p>\n<h2>\n  \n  \n  Templates\n<\/h2>\n\n<ul>\n<li>improve template placement consistency: now always on the right.<\/li>\n<li>change <code>&lt;~xxx~&gt;<\/code> to <code>:[xxx]<\/code>. shorter and can be <em>packed<\/em> <code>Ptr:[:[int]Ptr]<\/code> (before: <code>&lt;~&lt;~int~&gt;Ptr ~&gt;Ptr<\/code> with he space mandatory)<\/li>\n<\/ul>\n\n<p>So now all template can be written <code>xxx:[y,z]<\/code><\/p>\n<h2>\n  \n  \n  new keyword: <em>funcdef<\/em>\n<\/h2>\n\n<p>to disambiguate with <em>typedef<\/em> used for type aliases.<\/p>\n<h2>\n  \n  \n  Ability to fix functions\n<\/h2>\n\n<p>Inspired by a similar feature in haskell, you can now write<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight cpp\"><code><span class=\"cp\">#! Automatic conversion to pointer for the first argument\n#! default of value 1 for the second argument\n<\/span><span class=\"n\">fun<\/span> <span class=\"kt\">int<\/span> <span class=\"nf\">add<\/span><span class=\"p\">(<\/span><span class=\"n\">Ptr<\/span><span class=\"o\">:<\/span><span class=\"p\">[<\/span><span class=\"kt\">int<\/span><span class=\"p\">]<\/span> <span class=\"n\">i<\/span><span class=\"p\">,<\/span> <span class=\"kt\">int<\/span> <span class=\"n\">j<\/span> <span class=\"o\">:<\/span> <span class=\"mi\">1<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\n  <span class=\"k\">return<\/span> <span class=\"n\">j<\/span> <span class=\"o\">+=&gt;<\/span> <span class=\"o\">*<\/span><span class=\"n\">i<\/span><span class=\"p\">;<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"cp\">#! declare a variable\n<\/span><span class=\"n\">var<\/span> <span class=\"kt\">int<\/span> <span class=\"n\">i<\/span><span class=\"p\">;<\/span>\n\n<span class=\"cp\">#! traditionnal\n<\/span><span class=\"o\">&lt;&lt;&lt;<\/span> <span class=\"n\">add<\/span><span class=\"p\">(<\/span><span class=\"n\">i<\/span><span class=\"p\">,<\/span><span class=\"mi\">1<\/span><span class=\"p\">)<\/span>     <span class=\"o\">&gt;&gt;&gt;<\/span><span class=\"p\">;<\/span>\n\n<span class=\"cp\">#! chuck style\n<\/span><span class=\"o\">&lt;&lt;&lt;<\/span> <span class=\"p\">(<\/span><span class=\"n\">i<\/span><span class=\"p\">,<\/span><span class=\"mi\">1<\/span><span class=\"p\">)<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"n\">add<\/span> <span class=\"o\">&gt;&gt;&gt;<\/span><span class=\"p\">;<\/span>\n\n<span class=\"cp\">#! infix\n<\/span><span class=\"o\">&lt;&lt;&lt;<\/span> <span class=\"n\">i<\/span> <span class=\"err\">@<\/span><span class=\"n\">add<\/span> <span class=\"mi\">1<\/span>     <span class=\"o\">&gt;&gt;&gt;<\/span><span class=\"p\">;<\/span>\n\n<span class=\"cp\">#! prefix\n<\/span><span class=\"o\">&lt;&lt;&lt;<\/span> <span class=\"p\">(<\/span><span class=\"err\">$<\/span><span class=\"n\">add<\/span><span class=\"p\">)<\/span> <span class=\"n\">i<\/span>     <span class=\"o\">&gt;&gt;&gt;<\/span><span class=\"p\">;<\/span>\n\n<span class=\"cp\">#! postfix\n<\/span><span class=\"o\">&lt;&lt;&lt;<\/span> <span class=\"n\">i<\/span> <span class=\"err\">$<\/span><span class=\"n\">add<\/span>       <span class=\"o\">&gt;&gt;&gt;<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h2>\n  \n  \n  Conclusion\n<\/h2>\n\n<p>I think that's all (well that and the usual bug fix here and there).<\/p>\n\n<p>In my opinion, this is a huge improvement, but it's now up to you to tell me if there is something wrong, if you like it,  whatever...<\/p>\n\n<p>If nobody sees a problem with it, I'll merge next week.<\/p>\n\n","category":["proglangdesign","gwion","programminglanguagedesign","discuss"]},{"title":"Searching collaborators for a programming language","pubDate":"Tue, 25 Aug 2020 18:31:48 +0000","link":"https:\/\/dev.to\/fennecdjay\/searching-collaborators-for-a-programming-language-3io0","guid":"https:\/\/dev.to\/fennecdjay\/searching-collaborators-for-a-programming-language-3io0","description":"<p>I created a github organization to discuss development of <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\">Gwion<\/a>, please contact me (and provide your github nick) if you're interrested.<\/p>\n\n","category":["programminglanguagedesign","proglangdesign","help","gwion"]},{"title":"What would be the simplest way to output sound to browser from a C program?","pubDate":"Tue, 11 Aug 2020 11:07:49 +0000","link":"https:\/\/dev.to\/fennecdjay\/what-would-be-the-simplest-way-to-output-sound-to-browser-from-a-c-program-4m2n","guid":"https:\/\/dev.to\/fennecdjay\/what-would-be-the-simplest-way-to-output-sound-to-browser-from-a-c-program-4m2n","description":"<h1>\n  \n  \n  Getting gwion to the browser\n<\/h1>\n\n<h2>\n  \n  \n  Some context\n<\/h2>\n\n<p>I made this <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\">progamming language<\/a> to help in some of my musical projects. A few days ago I made a <a href=\"https:\/\/repl.it\/@GwionLang\/Gwion-latest\">Repl<\/a>. I think I have a way to provide drivers and libraries to it (leveraging github releases).<\/p>\n\n<h2>\n  \n  \n  The problem\n<\/h2>\n\n<p>As of now, I have no driver that could send the sound to the browser. I guess I could easily hack something around libsndfile to provide say, a .wav, but it would really be better if I could have some realtime output to web-browser.<\/p>\n\n<h2>\n  \n  \n  Do you have an idea?\n<\/h2>\n\n<p>So I'm asking here, as many DEV users have a good knowledge of web techniques and on my side I know, well, music and C.<\/p>\n\n","category":["help","gwion"]},{"title":"Is replit tag broken?","pubDate":"Sat, 08 Aug 2020 14:29:07 +0000","link":"https:\/\/dev.to\/fennecdjay\/is-replit-tag-broken-5137","guid":"https:\/\/dev.to\/fennecdjay\/is-replit-tag-broken-5137","description":"<p>I just added <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\">Gwion<\/a> to <a href=\"\/\/repl.it\">replit<\/a>. Well, I had already done so, but now I leverage github releases, so it loads way faster.<br>\nI wanted to shared it on <a href=\"\/\/dev.to\">dev<\/a>, as I have some remaining question, but it looks that the liquid tag for embedding replit is broken: on my machine, I can't see what I type ...<br>\nIs it just me or did I uncover some issue?<\/p>\n\n\n<div class=\"ltag__replit\">\n  <iframe height=\"550px\" src=\"https:\/\/repl.it\/@GwionLang\/Gwion-latest?lite=true\"><\/iframe>\n<\/div>\n\n\n<p>For sure one can check it <a href=\"https:\/\/repl.it\/@GwionLang\/Gwion-latest\">here<\/a>.<\/p>\n\n<p>There's the mandatory <em>hello world<\/em>, that you can run<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight shell\"><code>.\/gwion hello_world.gw\n<\/code><\/pre>\n\n<\/div>\n\n\n\n\n\n\n<p>Maybe it is only broken in the preview, in which case I'll delete this post.<\/p>\n\n","category":["question","replit"]},{"title":"What is needed for easy onboarding?","pubDate":"Sun, 26 Jul 2020 19:44:35 +0000","link":"https:\/\/dev.to\/fennecdjay\/what-is-needed-for-easy-onboarding-15d8","guid":"https:\/\/dev.to\/fennecdjay\/what-is-needed-for-easy-onboarding-15d8","description":"<p>Pretty much everything in the title...  <\/p>\n\n<p>I need teammates for <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\">Gwion<\/a>.<br><br>\nCurrently there is also most no user doc, let alone the dev one. I just started adding doxygen comments to the <a href=\"https:\/\/github.com\/fennecdjay\/gwion-util\">util<\/a> directory (not pushed yet), hoping it helps.  <\/p>\n\n<p>But maybe there is something I can do before that would be more useful.<br>\nWhat would you do?<\/p>\n\n","category":["help","proglangdesign","gwion","programminglanguagedesign"]},{"title":"Want to help development of a programming language?","pubDate":"Thu, 23 Jul 2020 16:10:22 +0000","link":"https:\/\/dev.to\/fennecdjay\/want-to-help-development-of-a-programming-language-4p1o","guid":"https:\/\/dev.to\/fennecdjay\/want-to-help-development-of-a-programming-language-4p1o","description":"<p>It's been a few years since I started developing my own programming language, because I loved <a href=\"https:\/\/chuck.cs.princeton.edu\/\">chuck<\/a>, but I felt it lacked at least generics and function pointers and  performance was quite poor . As of today, <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\">Gwion<\/a> is doing well in terms of features (even more than what I intented to have at first) and <a href=\"https:\/\/fennecdjay.github.io\/Gwion\/Benchmarks.html\">performance<\/a>.<\/p>\n\n<p>This niche project, IMHO, deserves some attention, and probably a community.<\/p>\n\n<p>To prevent <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bus_factor\">bus factor<\/a>, I'm now searching people who would like to contribute. There is much left to do in the documentation area, but I'd also greatly appreciate discussion on its evolution.<\/p>\n\n<p>Furthermore, there is <a href=\"https:\/\/blog.repl.it\/langjam?ref=newletter\">this<\/a> event coming, which I'd really like to be a part of, but I need teammates.<\/p>\n\n<p>Thank you for reading this far (I know my english can be confusing at times).<\/p>\n\n<p>What do you think? Would you join?<\/p>\n\n","category":["proglangdesign","gwion","help","programminglanguagedesign"]},{"title":"Correct order of programming concepts for a tutorial series","pubDate":"Sat, 11 Jan 2020 15:22:06 +0000","link":"https:\/\/dev.to\/fennecdjay\/correct-order-of-programming-concepts-for-a-tutorial-series-5f09","guid":"https:\/\/dev.to\/fennecdjay\/correct-order-of-programming-concepts-for-a-tutorial-series-5f09","description":"<p>I want to start a tutorial series for <a href=\"https:\/\/github.com\/fennecdjay\/Gwion\">Gwion<\/a>, accessible to beginners.<\/p>\n\n<p>For those who don't know <strong>Gwion<\/strong>, it is an interpreted programming language, strongly typed, running on a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Stack_machine\">stack VM<\/a> and with a <em>very strong relation to time<\/em>, as its main use is sound\/music generation.<\/p>\n\n<p>Right now, I think it should start like:<\/p>\n\n<ul>\n<li>Set things up: \ninstalling the language and libraries needed<\/li>\n<li>Sequential programming:\nJust set up a sequence of instruction<\/li>\n<li>Use functions:\nPut instructions in a function and use it instead.\nLeverage this post to demonstrate function overloading<\/li>\n<li>Use your Own classes:\nUse a class instead of a function and demonstrate inheritance.<\/li>\n<\/ul>\n\n<p>Later on will come templating for functions and classes, lambdas, functions pointers...<\/p>\n\n<p>Does it seem correct for you?<br><br>\nIf not, how would you order things?  <\/p>\n\n<p>Any advice will be greatly appreciated.<\/p>\n\n","category":["help","gwion","tutorial","programminglanguagedesign"]}]}}