HNHacker News
TopNewBestAskShowJobs

lucasluitjes

257 karma · joined November 9, 2020

I'm a one-stop dev/devops/infosec shop for startups. See https://www.luitjes.it for lots of details.
submissionscomments
lucasluitjes··on Ask HN: Freelancer? Seeking freelancer? (November 2023)
SEEKING WORK | REMOTE | Dev, DevOps, Security | Location: The Netherlands

Willing to relocate: no, but willing to travel/visit. I'm flexible with working hours, I usually work with clients from either Western Europe or the USA.

I do dev/devops/security, usually for startups or scale-ups or other small orgs with limited resources, and I've been doing that for 15+ years. So, if you:

* Have a slow web application that’s often down?

* Want to improve security and don’t know where to start?

* Have a legacy system that needs to be replaced?

* Are considering an acquisition but not sure about the technical side?

I can help with that. For example, in the past I have:

* Massively improved performance and reliability for a data visualization platform.

* Led a large effort to improve security for a cybersecurity SaaS.

* Built a micropayments system for a prominent media startup.

* Rebuilt an aging e-learning platform from scratch for a GDPR compliance SaaS.

* Conducted technical due diligence for acquisitions.

For more information: https://www.luitjes.it

Favorite buzzwords: Ruby (including Ruby on Rails, Sinatra, and standalone applications), PostgreSQL, Ansible, Linux.

Other buzzwords: Elixir, C#, Java (Spring/Hibernate), JavaScript, HTML/CSS/XSLT/XPATH/XSLFO, Elasticsearch, MongoDB, MySQL, Redis, Solr/Lucene, Graphite, Kibana, Grafana, Logstash, Icinga, Jenkins, Varnish, HAProxy, Pound, Nginx, Apache, Passenger, Vagrant, Docker, DCOS, Kubernetes, SSH, OpenVPN, TCP/IP, tcpdump/strace/lsof/etc, AWS (EC2, ELB/ALB, S3, CloudFront, Lambda, Batch, VPC, etc.

lucasluitjes··on Show HN: Monocle – bidirectional code generation library
Yeah, bidirectional code gen for no-code tools was our use case too (there's a demo video in the post if you're interested). I saw a bidirectional no-code platform called Vision X the other day, people are definitely working on it. Are the prototypes you worked on online somewhere? It sounds interesting!

There are a bunch of ideas for dev tools in the original post. For example if you integrate with linters, you could define more complex code smells without all the AST juggling. Upgrading rails apps (or other frameworks that have a similarly well-defined structure) to new versions might work, by defining monocles for old the old and new version.

lucasluitjes··on Show HN: Monocle – bidirectional code generation library
It is a compiler/decompiler, data models is just a simple example. There are also examples of generating and parsing controllers, views, schema and route files. But you can define your own templates, so you can parse/generate pretty much anything that has conforms to a common structure.
lucasluitjes··on Show HN: Monocle – bidirectional code generation library
Wow, those projects look really cool! There's definitely some overlap there.

I'd love to see it used for other projects/languages. At the bottom of the post I put a bunch of ideas that I'd integrate with it, if I had more time.

lucasluitjes··on Show HN: Monocle – bidirectional code generation library
Well, looking at the rails monocles (for matching controllers, views, etc) a common pattern is custom matchers/replacers for things like "ast.children.first.to_s.singularize.camelize", so a shorthand for defining those in both directions could be handy. Other than that, not right now.

But if there are common situations where you end up writing the same matchers/replacers, those would be prime candidates for built-in placeholders.

lucasluitjes··on Show HN: Monocle – bidirectional code generation library
OP here, we actually considered using the GetPut/Putget/CreateGet terminology during a refactor, but it didn't seem to map perfectly. As I understand it, with lenses you generally define them through a DSL. Monocle lets you define them through example code. The goal was to make it as easy as possible for a decent programmer to write a lot of them. I couldn't find that type abstraction in academic work, but it's entirely possible I didn't use the right search terms.
lucasluitjes··on Show HN: Monocle – bidirectional code generation library
Mito looks interesting! Regarding the sin, I don't think it entirely applies here, unless I'm misunderstanding you - I'm not super familiar with transpilers.

In this case the template is also ruby code, but with placeholders for the values. So both the template and the input get parsed into ASTs, then both of them are recursively walked and compared on the fly. During that walk it builds up the data structure with initial values.

In the code generation direction it walks one AST and does lookups and rewrites with values from the values.

Does that make sense?

lucasluitjes··on Show HN: Monocle – bidirectional code generation library
For regular languages (not templating), if they have good tooling for converting to/from AST it's quite possible. The codebase isn't very flexible right now, but it's also not very big. In fact monocle itself is less than 900 lines of code.

I'm not sure if it makes sense for monocle to support multiple languages, or if each language should have its own port. Someone writing monocles in a specific language probably wants to do custom scripting in the language they're used to.

Templating languages are trickier, because they usually don't have great tooling. In fact, we wrote our own tooling to convert from ERB to builder (a template system where you generate HTML through Ruby methods) and back. So for any templating language you would probably write a tool that converts from that language to builder, and back.

On the other hand, ERB is about as free-form as it gets. Templating languages that are more strict are probably easier to add. For more info on how ERB is supported, I wrote another post that goes into detail: https://blog.luitjes.it/posts/erb2builder/

lucasluitjes··on Show HN: Monocle – bidirectional code generation library
A friend who did some work on the project said it reminded him of lenses in functional programming. Since the company name was Snooty Software, he suggested calling the library Monocle, which seems appropriate :-)
lucasluitjes··on Show HN: Monocle – bidirectional code generation library
Thanks! Yes, it seems like an underappreciated direction. Hoping that this'll be a push towards that.
lucasluitjes··on Show HN: Monocle – bidirectional code generation library
I don't have the delete button, but I've emailed support. Thanks!
lucasluitjes··on Show HN: Monocle – bidirectional code generation library
Whoops, looks like I should've posted this as a link rather than text containing a link. Here's something clickable: https://blog.luitjes.it/posts/monocle-bidirectional-code-gen...
← PreviousPage 2 of 2