Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:01
    dependabot[bot] labeled #561
  • 10:01
    dependabot[bot] labeled #561
  • 10:01
    dependabot[bot] opened #561
  • 10:01

    dependabot[bot] on github_actions

    Bump actions/cache from 3.2.2 t… (compare)

  • 10:00
    dependabot[bot] labeled #560
  • 10:00
    dependabot[bot] labeled #560
  • 10:00

    dependabot[bot] on composer

    Bump friendsofphp/php-cs-fixer … (compare)

  • 10:00
    dependabot[bot] opened #560
  • Jan 30 10:16
    Chemaclass labeled #540
  • Jan 30 10:16
    Chemaclass unlabeled #540
  • Jan 30 10:09

    Chemaclass on 540-create-cast-int-function

    (compare)

  • Jan 30 10:09
    Chemaclass closed #554
  • Jan 30 10:09
    Chemaclass labeled #554
  • Jan 30 10:09
    Chemaclass unlabeled #554
  • Jan 30 09:41
    JesusValera commented #554
  • Jan 29 21:48
    jenshaase commented #554
  • Jan 29 18:51

    JesusValera on simplify-readExpression-method

    (compare)

  • Jan 29 18:51

    JesusValera on master

    Replace switch by match in Pars… Improve style Merge pull request #559 from ph… (compare)

  • Jan 29 18:51
    JesusValera closed #559
  • Jan 29 18:49
    JesusValera synchronize #559
Mariano Montone
@mmontone
I'm experimenting with some tool support for Phel for Emacs.
9 replies
I have syntax higlighting, indentation, etc (derived from clojure-mode).
And also some limited evaluation from buffers, REPL, etc.
I will try to provide some completion next.
Mariano Montone
@mmontone
phel2.gif
1 reply
Completions, list of arguments in mode-line, and apropos command.
Very much WIP, but to show the level of IDE integration that could be achieved with some work.
Michał Majchrzak
@m_a_j_ch_rz_a_k_twitter
wowoowowow
Mariano Montone
@mmontone
It will grow to more to support more things. But it already provides quite a few helpful IDE things as it is now.
That's the purpose of my project, to be able to provide IDE support for new interactive languages as cheaply as possible.
Still need to solidify the protocol and more, but hope I'm getting this right and this can become useful one day.
Mariano Montone
@mmontone
Is this a bug:?
(contains? ["str"] "str") => false
1 reply
Mariano Montone
@mmontone
This works btw: (some? (fn [s] (= s "str")) ["str"]) => true
Mariano Montone
@mmontone
phel-docs.gif
Definitions docs ..
Mario Bašić
@mabasic
@mmontone I might get into emacs just because of this! Nice work!
Mariano Montone
@mmontone
:)
I'd like to improve the installation. The installation of Emacs packages is fine, but for the Phel server side, you have to copy the Phel server file: https://codeberg.org/mmontone/interactive-lang-tools/src/branch/master/backends/phel/ilt.phel to your project directory and run it, somehow.
But I'm not sure what would be best to do.
Jose Maria Valera Reales
@Chemaclass

I did some improvements on the phel snake game. https://github.com/Chemaclass/phel-snake#how-to-play The main change is using the compiled phel code instead of compiling it all the time. Aka: compile once, and play as much as you want.

I added some composer scripts to simplify it even more:

  • How to compile the game? ./tools/composer compile
  • How to play the game? ./tools/composer play
  • How to compile and play the game? ./tools/composer start

After the game is compiled, you don't have to compile it again, so using directly the play command will give you a better user experience; the game will load way faster 🚀

# https://github.com/Chemaclass/phel-snake/blob/master/play.php
require_once __DIR__ . "/vendor/autoload.php";

$compiledFile = __DIR__ . "/out/phel_snake/game.php";
if (!file_exists($compiledFile)) {
    exit('You have to compile the game first. Try with: `composer compile`');
}
$GLOBALS['argv'][] = 'play';
require_once $compiledFile;
3 replies
Jose Maria Valera Reales
@Chemaclass
While it's not 100% Phel, it's somehow related, because Phel is the "father" of Gacela and Phel's architecture it's based on Gacela 100% which allowed us to create something totally framework agnostic 💡 And why not, it is great to share it with the community here as well: https://www.reddit.com/r/PHP/comments/xvafzh/gacela_helps_you_to_split_the_logic_of_your_app/
Jose Maria Valera Reales
@Chemaclass
I created this issue with a feature idea 💡 any thoughts about it? 🤔
Add __name__ to identify the execution of a script
phel-lang/phel-lang#523
Jose Maria Valera Reales
@Chemaclass
I created a PR related to this idea ☝️ I think this can be very useful, because I encounter myself a few times where this was an issue and I needed to find some work around to find a solution. Now it looks pretty straightforward:
phel-lang/phel-lang#524
Jose Maria Valera Reales
@Chemaclass

I will talk about Phel next month, the 10. Oct, about Phel for the Software Crafters Madrid community https://www.meetup.com/es-ES/madswcraft/events/289206891/ I think it will be in Spanish, but if you attend, and you have any question in English, feel free to participate.

My plan is to present the language, the story and motivation behind, and most likely do some live coding 🚀

2 replies
Michał Majchrzak
@m_a_j_ch_rz_a_k_twitter
Does anyone have some Phel + webframework examples ?
1 reply
Jose Maria Valera Reales
@Chemaclass
I added an alias to the API page: https://phel-lang.org/api
Now it's even easier figure out the internal API of Phel 💡
aolko
@aolko
Hi, noticed this language, wanna build a subset of php myself, can you help me with that?
16 replies
Michał Majchrzak
@m_a_j_ch_rz_a_k_twitter
Any doing the AdventofCode in phel?
1 reply
Jose Maria Valera Reales
@Chemaclass
I wrote a post for the 24 days in December blog about phel💡 https://24daysindecember.net/2022/12/17/introduction-phel-lang-a-native-lisp-for-php/
Jose Maria Valera Reales
@Chemaclass
If you are in Berlin the next 8th Feb, 2023, I will talk about Phel in the Symfony User Group Berlin, and you'll are invited! https://www.meetup.com/de-DE/sfugberlin/events/290735168/
Jens Haase
@jenshaase

🚢Release 0.8.0

Yesterday we released version 0.8.0 of Phel. This release adds support for JSON. Read the blog post for more information:

https://phel-lang.org/blog/release-0-8/

2 replies
Jivan Kulkarni
@jivank
It has been a while since I initially tried out Phel. I was wondering if it is now possible precompile into .php files.
Jens Haase
@jenshaase
@jivank there is now a build command that lets you convert the phel code to PHP code. The converted PHP code can then be uploaded to your production environment.
Actually currently it is named phel compile but it will be renamed to phel build in the next version
1 reply
Jivan Kulkarni
@jivank
Great! I am not too familiar with PHP but I assume each file would be its own endpoint? Or is there a way to define endpoints like httpkit for clojure?
Jens Haase
@jenshaase
@jivank In general you can do both. But the most common way in Phel and PHP is to have a single entrypoint and then define a router that calls a function. There is also a routing library: https://github.com/phel-lang/router (still in development)
Jose Maria Valera Reales
@Chemaclass
@jivank We just published a new documentation page that gives you a bit more information about the cli commands that you have with phel. Check this out: https://phel-lang.org/documentation/cli-commands/#compile-the-project

I prepared last week a scaffolding/skeleton for a web project written in Phel: https://github.com/phel-lang/web-skeleton there you can see the phel-lang/router project that @jenshaase mentioned above ☝️

It's just an idea with the intention to make it easier to start with the bare minimum and a working example. Feel free to give feedback and suggest changes as you see the need :)

Jivan Kulkarni
@jivank
Thanks! I am going to try deploying to a cheap/free PHP web host and see how it goes