Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 07 18:12
    Chemaclass commented #309
  • Jun 07 17:59
    Chemaclass closed #309
  • Jun 07 16:57
    Chemaclass commented #309
  • Jun 07 16:56
    Chemaclass labeled #309
  • Jun 07 16:54
    Chemaclass assigned #309
  • Jun 07 16:47
    kloimhardt opened #309
  • Jun 07 16:26
    Chemaclass converted_to_draft #307
  • Jun 07 08:14

    Chemaclass on 305-push-with-ref

    (compare)

  • Jun 07 07:41
    jenshaase commented #307
  • Jun 07 07:39
    jenshaase commented #306
  • Jun 07 07:39

    jenshaase on master

    Remove native php array from pu… Add support for native PHP Arra… Update changelog and 1 more (compare)

  • Jun 07 07:39
    jenshaase closed #306
  • Jun 07 06:43
    Chemaclass commented #307
  • Jun 07 06:43
    Chemaclass commented #307
  • Jun 07 06:34
    Chemaclass review_requested #306
  • Jun 07 06:34
    Chemaclass review_requested #306
  • Jun 07 06:34
    Chemaclass synchronize #306
  • Jun 07 06:34

    Chemaclass on 305-push-with-ref

    Update changelog (compare)

  • Jun 07 06:32
    Chemaclass edited #306
  • Jun 07 06:32
    Chemaclass edited #306
metehan
@metehan
actuallly I just came back to gitter to see if you finished your website
oh it doesn't have permissive license :(
anyway congratulations for the website :)
Mario Bašić
@mabasic
@metehan Usually I use MIT license, but considering that this time I have my personal information in the source code it made no sense to allow everyone to use my personal information. Maybe there is a license for this case, but I don't know which one.
metehan
@metehan
phel extenstion for VS code is pretty fine but maybe we can integrate some paredit functionaly
now I use calva instead of phel extension. it gives bad coloring and thinks my core is wrong but without paredit coding lisp is hard
metehan
@metehan
is there any html to ignore itself lets say in clojurescript if you write [:<> [:p "as"] [:p "sda"]] the [:<> ]element will be ignored and [:pelements will be forwarded to parent of [:<>
Jens Haase
@jenshaase
You can use an array for that: (html @[[:p "a"] [:p "b"]])
6 replies
Mario Bašić
@mabasic
Interesting, did not know that. I just figured that it works like React JSX meaning that you need to have one "root" component.
@metehan The one thing that was really helpful when coding Phel is bracket matching in vscode. That is basically all that one would need. After some time you get used to working with brackets. The extension could provide symbols which would show functions and variables defined in a document. That would be helpful, but I managed without it.
@metehan Regarding the license, I will look into it at some point in the future. I'm currently busy with other projects, so I will have to circle back to this.
1 reply
metehan
@metehan

@metehan ...Phel is bracket matching in vscode. That is basically all that one would need...

it's totally not "all one would need" :) you came from php as your website indicates. I can't imagine an effective coding experience without paredit on a lisp language. You should install calva paredit. after you try it then there is no way back from lisp family languages ;)

thank you Jens for the sample
Sean Walker
@swlkr
theres also parinfer if youre into that
metehan
@metehan
for now I am happy with calva and without phel support. parinfer is fine but not complete; travelling through sexps , barfing and slurping are missing.
Mario Bašić
@mabasic
@jenshaase Do you think that including links to my website source code and/or phel-json library would be good to have on the phel website somewhere? Maybe like examples or something like that...
2 replies
kloimhardt
@kloimhardt
Just published a 100 loc Phel backend for the canonical "guestbook" web-example. Thank you @mabasic for the inspiration.
Mario Bašić
@mabasic
@kloimhardt Nice! I'm glad that my code has helped you in some way :heart:
Jens Haase
@jenshaase
Hi everybody. I just want to inform you that I'm working on a pretty big change regarding Phel's data structures. I will replace the existing data structure with new persistent data structures similar to Clojure's data structures. This will break a few things in the next version, but I think it's worth it. If you want you can have a sneak peek by looking a the Pull Request: phel-lang/phel-lang#244
1 reply
Mario Bašić
@mabasic
@kloimhardt Can you add your project here: phel-lang/phel-lang#261 ?
kloimhardt
@kloimhardt
@mabasic project added. At the moment I am using your splendid JSON library to performantly exchange data between cljs<->phel. But with JSON, sending data of the form [:key1 {:key2 2} :key3] is tricky. I wonder whether in the new Pull Request there exists some kind of "read-string" function which would perfectly fit reading a String of cljs/EDN data into the new Phel data structures. One would lose performance by sending a String instead of JSON, but it would be very convenient.
kloimhardt
@kloimhardt
I made a reactive todo-MVC. For this I ported qlkit to Phel. Whilst its core is only 60 loc for the backend, it uses a Graphql variant for cljs<->Phel communication. The necessary data is held in the client-state and server updates are done asynchronously (except at app initialization). This means that the backend execution speed is not crucial. It is on-line here.
2 replies
Mario Bašić
@mabasic
This is maybe first of its kind, but I've rewritten JS on my personal website to F#. Now the backend is written with Phel and frontend is written with F#: https://github.com/mabasic/mariobasic-n7/tree/main/resources/js
Jose Maria Valera Reales
@Chemaclass
The project has already over 1000 commits! 🥳👏
1 reply
Jose Maria Valera Reales
@Chemaclass
I mentioned Phel in my latest post about OSS: https://chemaclass.medium.com/open-source-software-bc9f995354eb I hope you like it 🤘
Mario Bašić
@mabasic

@jenshaase Urgent! My server was losing disk space and after some analysis I found out that my /tmp directory was getting filled with files called like this: __phelV5EVe6. After opening one file I found this inside:

<?php
// /home/mabasic/apps/mariobasic-n7/vendor/phel-lang/phel-lang/src/php/Runtime/../../phel/core.phel
// ;;AA8MA,CAAC,wCAAD,CAAA,CAAM,CAAC,uCAAD,CAAA,uEAAA,iCAAA,CAAN,CAAA
($GLOBALS["__phel"]["phel\\core"]["load"])(($GLOBALS["__phel"]["phel\\core"]["str"])("/home/mabasic/apps/mariobasic-n7/vendor/phel-lang/phel-lang/src/phel", "/core/basic-constructors.phel"));

Could it be that Phel writes files to /tmp every time it compiles and then leaves the files behind?

Part of the output from sudo ls /tmp:

__phel7kD9MI  __phelFWpISU  __phelNGteJW  __phelV5DQBD  __phelcpOhI6  __phelkX5eqG  __phelsIASPq
__phel7kDJIx  __phelFWpIhm  __phelNGtgI8  __phelV5E0X9  __phelcpOo8c  __phelkX5z4k  __phelsIAYT8
__phel7kDg3Q  __phelFWpMeZ  __phelNGthKp  __phelV5E3nV  __phelcpP282  __phelkX6Y5Y  __phelsIAaqg
__phel7kDkmo  __phelFWpUFb  __phelNGtkqE  __phelV5EDkB  __phelcpP4Lf  __phelkX6n8z  __phelsIAfCo
__phel7kDlvR  __phelFWpdFe  __phelNGtnkL  __phelV5EHVk  __phelcpPJCf  __phelkX6ssK  __phelsIAjSo
__phel7kDoiH  __phelFWpigT  __phelNGtwcC  __phelV5EJ5d  __phelcpPtHY  __phelkX6tut  __phelsIAsxZ
__phel7kEEEP  __phelFWqJYK  __phelNGu5Va  __phelV5EVe6  __phelcpPueP  __phelkX6wp3  __phelsIAwag
Jens Haase
@jenshaase
Yes that is the case.
Mario Bašić
@mabasic
Can that be avoided somehow? It was taking over 6 GB on my server
Jens Haase
@jenshaase
You could simply remove the files. Maybe a Cron job would help for now.
Mario Bašić
@mabasic
I could not remove the files using sudo rm __phel* because there were too many files for bash. I had to use find . -maxdepth 1 -name "__phel*" -print0 | xargs -0 rm from inside /tmp directory
Jens Haase
@jenshaase
Ok
Mario Bašić
@mabasic
Is there a plan not to place the files there? Should I open a issue on github for this?
Jens Haase
@jenshaase
The compile command it the way to go
I will work on this after the next release
Mario Bašić
@mabasic
I see. Ok, I'll add this report on that issue
Mario Bašić
@mabasic
P.S. I should check /tmp on my PC as well. Because if this was taking 6GB on my server I am afraid to find out how much space this is taking on my PC.
Jose Maria Valera Reales
@Chemaclass
wow, I never thought about this, @mabasic thanks for the catch! 🤓
Mario Bašić
@mabasic
I would not have caught this if my server wasn't out of space xD. Here is the issue where we can track this: phel-lang/phel-lang#247
Jose Maria Valera Reales
@Chemaclass
New PR : "Allow print transients data structures" phel-lang/phel-lang#272
Reported by @mabasic
3 replies
Jens Haase
@jenshaase
@/all I just released version 0.3.0 of Phel. This release adds persistent data structures to Phel. It probably will break some stuff from version 0.2.0. You can read more about the new data structures on the website: https://phel-lang.org/documentation/data-structures/
8 replies
Mario Bašić
@mabasic
Can I do pattern matching in Phel?
2 replies
Mario Bašić
@mabasic

Still using 0.2.0 on my website, but I've managed to implement this functionality:

(route "GET" "/blog" blog/index)
(route "GET" "/blog/{slug}" blog/show)

in my "controller" show function I get the slug like this:

(defn show [request & [@{:slug slug}]]
  (println slug))

It can be further improved to support optional route parameters. Going to move my blog from gatsby.js to phel (website). This was my only obstacle so far.

On a side note. Using 0.2 is now difficult since the documentation is for 0.3. Can we implement documentation versioning somehow?
Mario Bašić
@mabasic
@jenshaase Phel is awesome! It is very easy to get back into it after some time. The new data structures are great (immutable and mutable). PHP interop is great. I still haven't tried using Phel in PHP, but being able to deliver a single library with Phel and PHP code inside is awesome. I can really see this language being attractive to PHP developers who are looking for a change, but don't want to leave the PHP ecosystem.
Jens Haase
@jenshaase:matrix.org
[m]
Regarding documentation: you can read the documentation on on the GitHub repo. Switch to tag v0.2.0
Mario Bašić
@mabasic
Found it, thank you.
Mario Bašić
@mabasic
@jenshaase Can you publish a new release? I need a new version with the PR for for loops merged
Jens Haase
@jenshaase:matrix.org
[m]
Was that already in 0.3.1?
Was=wasn't
Mario Bašić
@mabasic
Hmm ... I am using 0.3.1 and it seems like the for loops are still a issue