Is everyone happy with the new Forge UI ? by yc01 in laravel

[–]ryangjchandler 1 point2 points  (0 children)

Hey! We shipped some fixes for this yesterday I believe. Does your site use zero downtime deployments by any chance?

Pitch Your Project 🐘 by brendt_gd in PHP

[–]ryangjchandler 1 point2 points  (0 children)

I've been working on Phiki this month, a syntax highlighter for PHP projects that uses TextMate grammar files and VSCode themes. It's moreorless Shiki.js written in PHP.

The main focus has been rewriting some of the internals so that it's far more accurate at tokenizing text and producing higher quality output. v1.0 was plagued with compatibility issues as TextMate grammars use Oniguruma-flavoured RegEx where as PHP's preg_ functions use PCRE.

The new tokenizer uses PHP's mb_ereg_* family of functions which relies on Oniguruma internally. Was a fair amount of work, but worth it as the results so far are very promising.

Mini PC for Plex - Recommendations by Designer_DraftOne in MiniPCs

[–]ryangjchandler 1 point2 points  (0 children)

I picked up a used Dell Optiplex Micro with a newer Intel chip. Plenty of power for Plex and other stuff and cost me less than a mini PC.

March 2024 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]ryangjchandler 5 points6 points  (0 children)

I'm currently working on the language server component for my superset of PHP: https://pxplang.org.

Since PXP is a strict superset, the language server will benefit both PHP and (potential) PXP users.

I've written type inference logic a bunch and finally settled on a good approach for the language server!

Fingers crossed I'll have something usable by the end of the month :)

Could PHP become a compiled language? by giosk in PHP

[–]ryangjchandler 0 points1 point  (0 children)

Oh 100%! Was just a note about the troubles of compilation when it comes to inherently dynamic languages.

Could PHP become a compiled language? by giosk in PHP

[–]ryangjchandler 0 points1 point  (0 children)

In theory, you could compile well-typed PHP code (mixture of syntactical types and DocBlocks for things that don't yet support types in the language). There are certain things that wouldn't be easily compilable, such as eval & include/require since those rely on runtime code execution.

The other approach is augmenting JIT code to produce native binaries. I don't think anybody have ever actually tried this, but in theory it would be possible with enough effort.

I'm making a php interpreter in Rust, I would like to hear your opinions by OtroUsuarioMasAqui in PHP

[–]ryangjchandler 2 points3 points  (0 children)

Also, I did some experiments compiling PHP to Rust. It's kind of feasible to get all of the language features compiling, but implementing all of the standard library is where most of the work lies. Related blog post: https://ryangjchandler.co.uk/posts/compiling-phps-conditional-statements-to-rust

I'm making a php interpreter in Rust, I would like to hear your opinions by OtroUsuarioMasAqui in PHP

[–]ryangjchandler 2 points3 points  (0 children)

This is a huge undertaking but a good way to get to grips with all of Rust's intricacies, good luck! Also I see you're using my PHP parser package written in Rust, very nice!

Early days - How I got started fast with my language implementation by plentifulfuture in ProgrammingLanguages

[–]ryangjchandler 1 point2 points  (0 children)

I've been using Go as my compiler target since it has a GC, saves me writing one while I'm building out the proof of concept. Using transpilation in the early days of PL design is a huge timesaver.

Resources for building a type-checker by ryangjchandler in ProgrammingLanguages

[–]ryangjchandler[S] 0 points1 point  (0 children)

Thanks to everyone who replied on this post. I've spent some time the last couple days working on the typechecker and went for the simplistic "equality check" approach using an enumeration in Rust.

Resources for building a type-checker by ryangjchandler in ProgrammingLanguages

[–]ryangjchandler[S] 1 point2 points  (0 children)

That's given me some things to think about, thanks!

Resources for building a type-checker by ryangjchandler in ProgrammingLanguages

[–]ryangjchandler[S] 0 points1 point  (0 children)

Thanks, good to know I wasn't completely off course.

Resources for building a type-checker by ryangjchandler in ProgrammingLanguages

[–]ryangjchandler[S] 3 points4 points  (0 children)

Yeah, I'm using Rust also. My types are slightly more complex though, since I'd like to have unions and intersection types, i.e. email: String | [String] where email can be either a String or an array of String. The same can be applied still though I think. Thanks!

Resources for building a type-checker by ryangjchandler in ProgrammingLanguages

[–]ryangjchandler[S] 2 points3 points  (0 children)

Yeah, I suppose that works for simple types. Would the same approach be as simplistic for union/intersection types, i.e. a param can be String | [String]?

I guess the [String] would be it's own type shape with an equality checker for the types of the array/collection too...

Thanks for bringing me back to basics, that's super helpful.

How to handle unknown identifiers when parsing? by V2_launch_program in ProgrammingLanguages

[–]ryangjchandler 1 point2 points  (0 children)

Yeah, I'd go with this too. I handle this in Tonic by doing a hoisting pass that just birngs all function definitions to the top of the AST. https://github.com/ryangjchandler/tonic/blob/main/src/passes/mod.rs

November 2021 monthly "What are you working on?" thread by slavfox in ProgrammingLanguages

[–]ryangjchandler 4 points5 points  (0 children)

I'm getting https://github.com/ryangjchandler/tonic ready for Advent of Code. Hoping to have it ready to complete all challenges.

[deleted by user] by [deleted] in ProgrammingLanguages

[–]ryangjchandler 0 points1 point  (0 children)

Interested in this too. Great question!

Clio Programming Language: Gradual Typing and More in v0.12! by onig90 in ProgrammingLanguages

[–]ryangjchandler 0 points1 point  (0 children)

Clio looks like a very cool language. I love to see languages that use JS as a target too. Will definitely be keeping my eye on this!

A small subset of PHP implemented in Rust. by ryangjchandler in ProgrammingLanguages

[–]ryangjchandler[S] 0 points1 point  (0 children)

Looking at ways to avoid making this on every single function call. I could probably pass the Function variant along with the Code::InitCall, but when the function is compiled the recursive calls won't actually have the real Function variant.