Here’s a thing I feel conflicted about. I’m going to be migrating ~ several hundred thousands of lines of code in coming months (years??) from Swift to JavaScript. The code represents years of my previous work creating synthesizer patch editors. I’ve done a small portion of it already, and in the process, I’ve created scripts that use lots of regular expressions to help automate a lot of the grunt work, to varying degrees of success. But… (1/4)
=> More informations about this toot | More toots from chorist@merveilles.town
I tried taking a few examples of what I’ve done (the original Swift code, and the “translated” JavaScript code) and throwing those into ChatGPT and asking it to translate some additional Swift code based on those examples. (2/4)
=> More informations about this toot | More toots from chorist@merveilles.town
And it did a really good job. Much better than all of the custom regex stuff I’ve written so far. So I’m faced with the prospect that I could use it to potentially greatly accelerate this mountain of work I have in front of me. But I also don’t feel great about supporting the massive energy suck that is OpenAI.
I’m inclined to just do it though. It’ll be a relatively miniscule amount of compute time that I use to do it, in the scheme of things. But, then again, principles. (3/4)
=> More informations about this toot | More toots from chorist@merveilles.town
Anyway, just wanted to share so that anyone can give me their opinions. :) (4/4)
=> More informations about this toot | More toots from chorist@merveilles.town
@chorist I'd rather you didn't. It's not just the energy, it's bad on so many levels.
From what you wrote I guess you know this already.
But for example, do you realise that if OpenAI gets its way, just making the chips it needs will push global warming irrevocably over 2°C, without even running them?
=> More informations about this toot | More toots from wim_v12e@merveilles.town
@wim_v12e I didn’t know that particular fact. But I’m aware that their desires for scaling are at dire odds with efforts to reduce energy consumption for global warming mitigation.
My rationalization is that what I’m considering is a “one-time” use to complete a fixed-scope project, as opposed to integrating an AI product into my on-going workflows/“needs”.
So I guess a question I have is, “is giving OpenAI $40 to save myself months of work a significant contribution towards a bad future?”
=> More informations about this toot | More toots from chorist@merveilles.town
@chorist No single individual's contribution is significant. It's the aggregate that causes the damage.
I am not going to even try to convince you. There is no absolute morality.
=> More informations about this toot | More toots from wim_v12e@merveilles.town
@chorist It does make me sad though.
=> More informations about this toot | More toots from wim_v12e@merveilles.town
@wim_v12e I hear that. I guess part of why I’m posting about this is because it’s an instance where I think I’m going to make a decision that somewhat compromises my values, but is hard to resist, and I’m struggling with it, and sharing that shows that just like everyone else I’m not perfect. And that I think there’s always room for nuance in these situations. And I value hearing what other people think about it. I appreciate you responding to the post.
=> More informations about this toot | More toots from chorist@merveilles.town
@wim_v12e @chorist Are there smaller programming focused models that are still useful? :flan_think:
Like, something with the footprint of a heavier static analysis tool.
=> More informations about this toot | More toots from csepp@merveilles.town
@chorist Have you tried transforming an AST dump instead of working on the textual representation? Swift's compiler should have such a feature, if not, find a Swift grammar for Tree-Sitter and have it dump an AST.
=> More informations about this toot | More toots from csepp@merveilles.town
@csepp I haven’t. I’ve thought about something like that but didn’t have the vocabulary to really formulate the thought well!
The “translation” I’m doing is a combination of syntax (obviously, Swift to Javascript) but also structural changes (e.g. what was in Swift a custom type is now in Javascript an array or vanilla object with a specific structure).
Does an AST approach seem to fit within that?
=> More informations about this toot | More toots from chorist@merveilles.town
@chorist Yup. Source code has a tree structure, so a tree representation is the minimum that you need. For variable renaming and such you might need something more.
=> More informations about this toot | More toots from csepp@merveilles.town
@csepp Thanks, I’ll look into that. I would certainly prefer an approach without the fuzziness and mistakes of an LLM, or the fuzziness and mistakes of my 68 regular expressions as well!
=> More informations about this toot | More toots from chorist@merveilles.town This content has been proxied by September (3851b).Proxy Information
text/gemini