Live data from Hacker News

OpenAI is good at unminifying code

glama.ai

31–40 of 321 posts

Re: OpenAI is good at unminifying code

#31
post #12

LLMs are excellent at text transformation. It's their core strength and I don't see it being used enough.

One potential benefit should be that with the right tooling around it it should be able to translate your code base to a different language and/or framework more or less at the push of a button. So if a team is wondering if it would be worth it to switch a big chunk of the code base from python to elixir they don't have to wonder anymore.

I tried translating a python script to javascript the other day and it was flawless. I would expect it to scale with a bit of hand-railing.

Re: OpenAI is good at unminifying code

#35
This is very close to how I often use LLMs [0]. A first step in deciphering code where I otherwise would need to, to use the authors words, power through reading the code myself.

It has been incredibly liberating to just feed it a spaghetti mess, ask to detangle it in a more readable way and go from there.

As the author also discovered, LLMs will sometimes miss some details, but that is alright as I will be catching those myself.

Another use case is when I understand what the code does, but can't quite wrap my head around why it is done in that specific way. Specifically, where the author of the code is no longer with the company. I will then simply put the method in the LLM chat, explain what it does, and just ask it why some things might be done in a specific way.

Again, it isn't always perfect, but more often than not it comes with explanations that actually make sense, hold up under scrutiny and give me new insights. It actually has prevented me once or twice from refactoring something in a way that would have caught me headaches down the line.

[0] chatGPT and more recently openwebUI as a front end to various other models (Claude variants mostly) to see the differences. Also allows for some fun concepts of having different models review each others answers.

Re: OpenAI is good at unminifying code

#36
post #12

LLMs are excellent at text transformation. It's their core strength and I don't see it being used enough.

The problem is the use case is where you don't care about the risk of hallucinations or you can validate the output without already having the data in a useful format. Plus you need to lack the knowledge/skill to do it more quickly using awk/python/perl/whatever.

Re: OpenAI is good at unminifying code

#38
post #12

LLMs are excellent at text transformation. It's their core strength and I don't see it being used enough.

One potential benefit should be that with the right tooling around it it should be able to translate your code base to a different language and/or framework more or less at the push of a button. So if a team is wondering if it would be worth it to switch a big chunk of the code base from python to elixir they don't have to wonder anymore. I tried translating a python script to javascript the other day and it was flaw…

see projects like https://github.com/joshpxyne/gpt-migrate

think there's also a YC company recently focusing on the nasty, big migrations with LLM help

Re: OpenAI is good at unminifying code

#40

LLMs are good at modeling and transforming text, news at 11. AI proponent hypes AI. I could go on, but I shouldn't have been this sarcastic to start with

You should be. I am facepalming at the topic and every single comment in here. It's so full of holes, the Swiss dairy industry went out of business.
Post reply on HN