I recently started paying for it. The simplicity from taking code from chatGPT to testing in realtime in the cloud, to deploying to production is amazing. Granted I am a hack developer but its created a new world for me. I'm done trying to create local development environments, I've wasted too much time in that regard.
Edit: If I figured out a production app that had legs, I would move it away to save on costs. It's more of a test space for me.
> I'm done trying to create local development environments
I went the other way. I suppose it depends on the nature of the project, but I can spin up a new environment in a couple of minutes. Maybe a couple more if I need to configure a Docker container.
In an open market with alternatives I can’t really sympathize with points of view such as “I don’t like that pricing went up so my vendor can be profitable.” If you like a product and want it to be available long term, you would want it to be a self sustaining business, not a cash bonfire.
This argument doesn't really make any sense. Why would anyone be loyal to one specific vendor when, as you say, there's many comparable alternatives available? You don't intentionally buy food at the most expensive store just to make the store more sustainable/profitable, do you?
> You don't intentionally buy food at the most expensive store just to make the store more sustainable/profitable, do you?
I do regularly; I don’t know if it’s the most expensive, but it’s absolutely not the cheapest. However, it’s a small market just a few blocks walk away and a small business and I value the proximity of it to my home so would like to see it continue to exist.
I think the decision should be reframed as: am I trying to spend as little as possible, or maximize value, which aren’t always the same thing.
Exactly. This is just an example of valuing service (proximity, owners we sympathize with) over and above the product they carry. Nothing wrong with it.
Yeah, agree with you. I also like going to a local farmers market. Because of proximity, familiarity, the idea of supporting local businesses, quality, etc. I feel none of that for Silicon Valley Webapps. You’re cheaper and better, I subscribe, your competition gets better and cheaper, I am out.
comprehension in the mud. speed to keyboard ftw! the glaring contradiction doesn’t seem to even register:
(a) i do (ie intentionally buy from the most expensive store)
(b) i don’t know if it’s the most expensive but it’s absolutely not the cheapest. (i.e. maybe i don’t, in fact)
I’d switch for a comparable product at a better price point. If there isn’t a comp (I’m not sure in this case), then I don’t get complaining about prices going up for a cloud service at a reasonable rate if you want that service to be around in the long run.
That said I do pay more for organic locally grown produce. Personal choice because those local tomatoes are banging
> You don't intentionally buy food at the most expensive store just to make the store more sustainable/profitable, do you?
I do, actually, because I want my local natural foods co-op to stay in business.
But your point still stands. The alternatives aren't actually comparable, because they're for-profit entities, and I don't want my food budget going to them.
It's one thing to support your local grocer and totally different to support a company with multiple millions in VC funding, especially when they company doesn't even offer you much advantage (Lisp features)
It doesn't usually take you 1-3 months to master eating food from the other store, whereas a language/platform is a major investment of your time. And you become a part of a community that helps each other, so making sure the community thrives is a worthwhile investment (hopefully greater than whatever you're paying monthly / what you spend comes back to you in opportunities).
If you're trying to start an actual business, it's very very difficult to get people to pay for your solution when a large incumbent can just pay people to use their competitive (potentially sub-standard) product by burning through mountains of, (sometimes not even their own), money. Or once you start to gain some traction, deplatform you from social/search, or bury you in frivolous lawsuits. It can be done, it's just not very straightforward (unless you also already have your own mountains of cash, or are very well connected). But, business is business, so sink or swim?
Otherwise, it's much easier to ride someone else's huge marketing budget (Apple App Store, WordPress plugins, ChatGPT etc.), which doesn't change the competitive landscape and gives those incumbents even more power (merchants/developers/creators touched by the platform's Midas finger become dependent on the platform because it's their income, then their users buy further into the parent system, etc.).
That was a pretty bad example. Grocery stores often pressure farmers to make harsh discounts on bulk sales. I rather pay a bit more at the farmers market instead. Also, I rather buy organic when possible. People pay more for ethical reasons all the time.
But in this case if you don't agree with the price increase, as OP further justifies, I think it's totally fair to just go elsewhere.
They don't like it that they're being asked to pay more, while removing features they use, for new features they won't use. Replit could have easily lumped AI features under an add on plan instead of pushing the costs onto everyone.
Since they have to maintain files and lisp support out of band, they're really not far off from running dev containers, which defeats the point of Replit.
1. Since you say it is an open market with alternatives, I don’t see why you seem to take issue with the blog post author taking one of the alternatives.
2. I thought the author did have some issues with the product. Like lack of persistence of uploaded files, price going up, and the support for the author’s current main language, Lisp, being not as good as for Python.
These two sentences inspired me to comment: “I actually saw it coming when Replit began receiving massive funding by major investors, who are likely pressuring the company to reduce costs and turn profits. Still, this left a sour taste as it felt like a bait and switch.”
I don’t see how it’s a bait and switch to increase prices to a sustainable level if it wasn’t previously there. If you like a SaaS product you should hope their business model is aligned for durability exclusive of burning VC cash in my view.
If the product doesn’t meet your needs, fair game. Complain away it’s good feedback the vendor needs to hear to improve. Vote with your dollars like this author did.
> If you like a SaaS product you should hope their business model is aligned for durability exclusive of burning VC cash in my view.
Sure, but that doesn't make their actions not bait[ing you with a low price and lots of features] and switch[ing plans to remove some of those features and raise the price].
It's still a bait-and-switch move, IMO. You might choose to tolerate or accept it in the interests of the company being sustainable, making it a "bait and switch that you're OK with".
Isn’t that what makes a market with price elasticity? Some participants choose to buy at price X with features {F}, but not to buy at price X + Y with a smaller feature set.
> Replit changed its paid tiers by raising the price of my plan and removing some features.
That’s a healthy and fine market outcome. What was worth it before is now no longer worth it to some buyer. Neither the ex-buyer nor seller should be surprised or upset here, as the points of view of both are entirely rational.
Google makes money from me, and is thoroughly enshittified. The goal of business is state-backed monopoly and extraction, which is not always aligned with or predicated on user value.
I generally find superior value from sources that are less singularly profit motivated such as worker-owned organizations or public goods providers
> If you like a product and want it to be available long term, you would want it to be a self sustaining business, not a cash bonfire.
In the absence of a source showing all of their financials, this isn't a particularly helpful comment. Beyond that, if they raise the price too much and go out of business, their customers are certainly not better off.
> If you like a product and want it to be available long term, you would want it to be a self sustaining business, not a cash bonfire.
Do I have a say on how they should/shouldn't invest their money? I imagined. So I can't really sympathize with points of views such as this. Are tech companies entitled to eternal growth?
On the flip side, if your business model is “we’re going to set hundreds of millions of dollars on fire to entice customers with artificially low prices to try and corner the market” you can’t really be surprised that when you eventually raise prices you’ll lose your price sensitive customers to the competition.
Completely agreed and that’s why I started my comment about open and competitive markets. Pricing under cost with VC cash subsidies to later raise prices after cornering a market is vicious and anticompetitive in my view. And it’s a market where consumers shouldn’t be surprised about prices rising aggressively over time
why would I, an user, should care at all about anything that my service provider does internally?
Why shouldn't i switch to any other provider as soon as I'm unsatisfied with current one?
This seems like really really dumb line of thought that leaves you to be exploited by service providers. It's basically mental vendor lock-in.
It's up to service provider to find out the profitable business model, and you don't need to integrate deeply with such unprofitable service providers.
Would you mind elaborating on the moral argument for continuing to support a company whose service no longer aligns with your goals/needs?
I think the best moral argument I can come up with is trust/loyalty and viewing it as a relationship, but that's not emotionally persuasive with large companies like we have in tech I think.
>>> why would I, an user, should care at all about anything that my service provider does internally?
I suggested, "morals".
In short, I responded to a question asked but you seemed mistakenly to think I was responding to the context in general.
In any case, let's go reductio ad absurdum, if your service provider employed child and/or slave labour then you may feel that enriching them with your custom was not appropriate.
There's a whole industry [0] devoted to choosing manufacturers according to their morals and socio-political positions; I thought the response was self-explanatory.
As far as paying a company that doesn't meet your needs any longer. I've done this when I approve of the company as a general source of good (benevolence). But only on a couple of occasions. I'm sure it's a very weak signal.
Yes, with large for profit companies I'm not going to do this. There is a situation where you might - to retain rights that are given to customers. Some people pay for the cheapest insurance to get access to discounts (UK) afforded to customers. There might be a situation where retaining customer rights was like having a company on retainer which probably comes into your trust/loyalty category.
This seems like a disingenuous comment. No one wants a vendor to be unprofitable. Sometimes a business is extremely profitable but just wants more profit, and then after they reach that profit, they want more. The problem is vendors want ever increasing profit and often they do this while being incredibly wasteful, so they take ever more customer money, burn it needlessly and then try to tell you that if you complain is because you want free stuff.
> If you like a product and want it to be available long term, you would want it to be a self sustaining business, not a cash bonfire.
He doesn’t want the product at the current price. It’s a bad value for him.
You’re requiring the consumer to want management’s goal. But product survival is not a buyer’s goal. The buyer has limited money, and wants his own profitability.
Especially considering there isn't a high barrier to entry in the space and there are a hundred alternatives, with more popping up every day. If a polished, fully-featured service charging like $10/mo is too much then it's really your expectations that are the problem.
While I completely agree with your reasoning, the end conclusion misses an other point: some companies are effective and efficient at the same time, while others are not. So making a switch can make complete sense even if your reasoning is followed.
IMHO replit is great for spinning up a dev configuration and doing some prototyping.
It's also really good for teaching, and for sharing live-coded snipets and so on.
I have no idea about using it for actual production coding, and deploying from a repl, as I haven't tried it because it it looks far less suitable than a traditional development workflow.
But it seems like they've received some 'investment' that may be pushing them towards being an actual production tool. IMHO, this will cause them to lose their hobby, hacker, and education patrons, and still not win with serious professional, commercial ones.
> Finally, like other development tool vendors, Replit is doubling down on AI coding features which affect the cost of paid plans. But I'm not interested in this as the whole point of my hobby programming is to write all the code myself and learn from the experience.
I sometimes wish companies had „dumb“ plans where I could just pay less for the main product instead of the bolted on intelligence.
The next 5 years are going to be hell. Expect AI pushed into everything but the kitchen sink. With the accompanying price raises whether you want the "feature" or not.
The idiom is with “but,” but I think the joke is it’s going to be so pervasive that it’ll definitely be included in sinks too. There are already smart sinks so it’s pretty much inevitable.
I was on the Hacker plan ($8 a month) but now I've been upgraded to the Core plan ($20 a month) and I pay annually but I'm guessing it won't change until renewal unless I've been grandfathered.
It is definitely a big jump in cost.
I use replit for my experimental projects when I just need a quick place to write some code to see how to do something. I use the git integration with GitHub which is really helpful.
I wouldn't want to set up Nix myself, but I appreciate that the "replit.nix" is easy to add packages that are necessary.
Why not? Even the official installer is pretty straightforward, the biggest bottleneck that comes to mind is setting your flakes up with the right template. Even then... I don't think I spend more than 15 minutes a month editing or fixing my flakes. It feels more like a superpowered makefile than a roadblock; I recommend learning the ins-and-outs even if you intend to stick with hosted environments.
I am not at the point I have a mental model of what Nix really is that I have with git.
I understand it has something to do with derivations where each package is a collection of files at a given version and the data and state is immutable. Which reminds me of Git.
It's also a programming language for expressions which evaluate to a hierarchy of files on disk.
pkgs.git, pkgs.vim
I find the tooling, command line utilities aren't immediately understandable to me. I just rely on that Replit have implemented the Nix integration so that when you change "replit.nix" it just updates the environment :-)
I really ought to give an immutable desktop a go at some point such as Silverblue .
One thing I really liked about Replit is being able to spin up a public website really quickly and just 'code in production'. It's really great for one off projects/demos, I think they've removed that from the free plan now though.
I built my own self-hosted Replit 'clone' for replicating that specific use case but under my control. I mapped a wildcard subdomain to my server and wrote a web IDE and backend using Docker's REST API and Openresty to spin up quick projects that are publicly accessible. It works really well for me, I haven't open sourced it because I don't know if anyone else would want it though.
Before dropping code you could do a series of blog posts on how all the pieces fit together. Those could generate some signal, to know of the next steps are worth it.
I don't need that specific use case but I do love seeing the tricks folk do with Docker. Maybe all you have to share is a readme and compose yaml?
Replit is one of those dystopian things that I hope fails.
Let’s move programming entirely into an environment where you don’t own your data, can’t duplicate or fully understand the runtime, are subject to total surveillance and the harvesting of your data for AI training and other monetization, and must pay rent forever with the constant threat of a rug pull. Great idea.
The thing I find most dystopian about it is that it’s aimed at beginners in a lot of ways. So you could have a generation raised up that doesn’t understand the idea of general purpose compute under their own control at all. Basically it’s the last nail in the coffin of personal computing.
As someone who is mentoring a budding software engineer, let me offer you a different perspective.
I have a friend who got a fine arts degree in college and has spent the last several years working crappy odd jobs to make ends meet, and finally came to me earlier this year and said she wants to learn to be a web developer. I got her set up learning JavaScript in all of 10 minutes using Replit, and frankly it was exactly what I would hope for pedagogically. It's free for our purposes, dirt simple to set up, and has enough features to be helpful without being overwhelming.
We've gotten to a point now where we're introducing HTML and CSS and building real websites (after about 3 months of JS intensive) and I decided this was the right time to introduce coding locally rather than in Replit. She's a computer savvy person and was able to stumble her way through it in a couple of hours (she didn't want my help as this is how she learns stuff) but I can tell that the need to manage a locally running environment slows her down. This is a good thing in the long run of course, and I think pedagogically there's analogues to this in many disciplines (in learning piano, for example, moving from simple drills and method books for learners to "real" music feels as significant a leap), but the step function in complexity to do simple tasks is certainly there. It's important to jump that hurdle, but forcing it too early can discourage early learning and cause you to focus on the wrong things.
I had her shadow me working on a side project early on in her studies so she could see what the whole process looks like, and the sheer number of tools I was jumping between to do my work (AWS, Vim, the terminal, database query console, developer tools) was overwhelming. Replit allows you to focus on only the most important parts of the theory of programming, which is absolutely essential when starting out if you aren't immediately predisposed to doing complicated stuff on your computer. I think it adds a lot of value, so long as it's used responsibly in the context of a larger curriculum.
A bit of a random question and a bit off topic but would she offer you the same amount of attention and help if it was the other way around and you wanted to learn how to code?
At my old university one of the intro classes moved all their students to Replit. Which might have been fine in isolation, but I think it created a year of students who struggled endlessly to use gcc, Makefiles, debuggers, or local tooling in general. Starting your CS journey with the local command line seems to put you into the perfect headspace right off the bat, even if it is a little slower to get going.
Well, those OS differences taught us to write (or strive to) portable code. It also taught me to better appreciate strengths in different operating systems over the years.
There's a lot of magic behind being able to write basic code and see the output on the screen.
I hate setting up environments, even with a folder of templates I've assembled over the years. The most frustrating barrier to get to the "magic" of seeing something happen is figuring out the proper/correct way to structure a project.
Towards the end of intro courses seems like an appropriate time to start bringing up tooling.
Reflecting a little bit more I don't think it was replit's fault, per-say. But that change should have been made together with a larger adjustment to the program. Like adding a class/unit in the style of [the missing semester](https://missing.csail.mit.edu/) to make sure people came away with a good range of intuitions.
1) Replit is far from commercially successful relative to capital raised
2) The market demand for dramatically more accessible software development tools (more economical product development) is essentially unbounded
3) Replit has produced a marginal change in the frontier of accessibility, at unknown unit economics
4) What would a discontinuous change (step change) in accessibility look like?
Side note, ZIRP and AI have really muddied the waters here. ZIRP means we still don't know yet which companies are zombies. The AI claim is that product development will soon be decoupled from the economics of human coding. Neither of these issues are likely to be conclusively resolved for another few years (we can all place our own bets). Replit is deeply rooted in both.
we've hardly seen anything yet, ZIRP has second and third order effects which will take years, a decade, to shake out. Early stage startups are only just beginning to run out of cash (after layoffs and tightening last year), the Great Flushing hasn't even started! And that's just early stage, anyone who raised from a superfund 2 years ago still has 4-5 years runway in the bank after the 50% layoffs this year. These entrepreneurs, and their backers, may not even have realized yet that they themselves, their having been selected, their very existence are in fact ZIRP artifacts. They still think their valuation is real, and that they earned it!
Agreed. First was "Will your company fold in the next 6 months, now that you no longer have free money?"
Now it's likely more "What is your growth efficiency (dollar:growth) in a capital-constrained environment?"
And we're going to see more and more capital sucked back into debt service, as financing comes due and is reestablished. Which will snowball the terms for any companies which require capital infusion ASAP.
It'll be curious if the Berkshire Hathaway model of coupling low-growth, good cash-flow businesses to high-growth, bad cash-flow engines becomes dominantly competitive again.
That’s exactly the point of Replit. It removes a lot of the barriers that are keeping people from using programming in their daily lives.
The goal of personal computing was to make computers, with all their power, available to everyone. In that Replit is much more of a continuation of that work than its antagonist.
Once all computing is in the cloud there are going to be a lot of new barriers.
I could see everything you do being monitored for the implementation of unauthorized types of software for example, not to mention total surveillance and appropriation of everything you do.
“We’re sorry but it appears that the software you are implementing might be able to be used to facilitate communication without the required safeguards. Your project has been locked.”
Meanwhile if the center of gravity goes entirely to managed cloud services the endpoint will wither even more. I can see a future where you can’t even buy a general purpose computer except in the most raw form like SBCs or parts and doing so might even get you on a list.
Look at the EU chat control stuff or the crazies who want to ban matrix math. This is not that far fetched.
I'm not actually familiar with the issues that VSCode has but I seem to recall some key component was not OSS, but I forget the details there and maybe it has changed. I know it has telemetry and such, but AFAICT that can be disabled by some settings. (I personally use vscode for my own work and disable telemetry and don't use any code assistant platforms, and I would like to know if there is a problem with what I'm doing)
I think parent refers to Codespaces and vscode.dev, not VSCode proper. These can indeed become gradually more locked down since they are completely online and out of the user's control, and as the UX difference between offline and cloud shrinks, people (especially new generations of developers) will slowly migrate there because of the convenience of not maintaining a toolchain themselves.
Yes, this, but add Copilot and other such frog boil extensions into the mix, as well as the slow encroachment into the built-in terminal; all tooling that is slowly both making certain things easier while making understanding what's going on harder.
I tried Replit for a]small Common Lisp and Clojure projects. It was OK, but I decided that I liked having a remote VPS with both languages and EMacs properly setup. My use case was being able to write code on my iPadPro while traveling or sitting in my living room. I don’t do that anymore, BTW.
There’s a good reason to provide AI even in the lowest plan, which means they need to charge a higher price:
They’re focusing on AI capabilities at the core of the product, because they believe that’s the future of software development. It’s admirable that they can make such clear decisions rather than waffle in an attempt to make everyone happy
Focus = Speed. Focus means saying no to the good to focus on the great
I use replit to give people a quick way to play with my open source projects online without installing anything on their computers (https://replit.com/@pimaj62145/SQLPage).
But I have always been on the free plan. Their paid plans are indeed very expensive for what they offer.
You’re not missing anything. The draw of these is a one click opinioned setup (containerized for codespaces). It does save a lot of time, but as someone who enjoys tweaking neovim config I don’t feel the draw.
That being said, I did setup a codespace for a one click to try a new feature product and that was very cool.
If you work on several projects in different environments and languages, and need to check out new ones quickly, it saves a lot of time if you don't have to set up an environment locally (especially if you don't even have the necessary platform or hardware).
I work in embedded, but we just pushed out VSCode Dev Containers (docker images that natively run a vscode server that your client attaches to) and it has been the greatest thing ever.
Clone the repo, open in container, complete toolchain with all the extensions and settings you’ll need. I absolutely love it.
The only thing I could think of is automatic syncing between devices. I have tried various options for this on PC, but this simple looking problem is far from solved.
> I value readability and usefulness for real code. There are some places where map() and filter() make sense, and for other places Python has list comprehensions. I ended up hating reduce() because it was almost exclusively used (a) to implement sum(), or (b) to write unreadable code.
No. A functional language is a language that primarily uses functions as defined in mathematics for it's programming language. Functions defined in mathematics are single lined expressions where no mutation takes place.
In traditional languages programs are a list of procedures that change and mutate state.
A list comprehension is functional in every way as it is a single expression. It does not change state. It is functionally equivalent to map and filter and even flatmap.
If you need an official source you just need to know that list comprehensions are borrowed from haskell. That's where the term came from and that's where the feature was borrowed from.
I don't really see how list comprehensions aren't functional- it's just a different notation for dealing with maps, filters, and cartesian products. Python borrowed list comprehensions from Haskell in the first place.
(not GP and I agree with you, and wanted to add some additional thoughts that may help others.) The comprehensions are great and have a functional flavor, sure. But when you hit the corner cases in Python you feel that the addition they provide to Python are not taking the language close to Haskell. Lambda functions within the Python comprehensions have limited power, reductions don’t work as nicely with comprehensions as map or filter; more generally, when you compose comprehensions things feel messy without the ability to pipe previous results to a next function, so you are using lots of intermediates and have to think of useful names which is hard. The end result can be good and closer to pseudo code, which is fantastic. However Python does not satisfy the need of many people used to lisp and often takes much longer to get right in those complex corner cases where Haskell or lisp would make validation and testing much easier.
> Lambda functions within the Python comprehensions have limited power,
lambda functions in python have as much expressive power as any function.
>comprehensions things feel messy without the ability to pipe previous results to a next function
compose :: (a -> b) -> (b -> c) -> (a -> c)
is definable in python Along with type checking. This is basically your pipe operator. Python has very much the capability to come rather close, closer than javascript to the flavor of functional programming found in ML languages like haskell.
The benefit of using python is that you can cheat a lot too which is more challenging to do in language as strict as haskell.
Here:
from typing import Callable, TypeVar, List, Any
from numbers import Number
A = TypeVar("A")
B = TypeVar("C")
C = TypeVar("C")
def compose(f: Callable[[A], B], g: Callable[[B], C]) -> Callable[[A], C]:
return lambda x: g(f(x))
def curry(f: Callable[[Any, ...], Any], x: Any) -> Callable[[Any, ...], Any]:
return lambda *args: f(x, *args)
def compose_many(fs: tuple[Callable[[Any], Any], ...]) -> Callable[[Any], Any]:
return (lambda x: x) if len(fs) == 0 else fs[0] if len(fs) == 1 else compose(compose(fs[0], fs[1]), compose_many(*fs[2:]))
MultAllType = Callable[[List[Number], Number], List[Number]]
multAll: MultAllType = lambda x, y: [i * y for i in x]
SubTractAllType = Callable[[List[Number], Number], List[Number]]
subtractAll: SubTractAllType = lambda x, y: [i - y for i in x]
quadrupleAndSubtractTwoFromAll = compose_many(
curry(multAll, 2),
curry(multAll, 2),
curry(subtractAll, 2))
as literals:
quadrupleAndSubtractTwoFromAll = compose_many(
lambda x: [i * 2 for i in x],
lambda x: [i * 2 for i in x],
lambda x: [i - 2 for i in x])
Python gets a bad rep for being noob language but it's capable of functional programming with very very good type checking. You can cheat too and go no types like lisp as I've shown in the example above.
Overall I would say it's superior to typescript in terms of functional programming due to exhaustive pattern matching (which I did not demonstrate above.)
In terms of FP in python versus FP in lisp it's mostly just opinionated differences. Python and lisp sort of even out because python has optional type checking and lisp has macros. I would say though that python leans more towards the ML flavor of FP which makes it less comparable to lisp. Apples and Oranges.
Lambda functions in Python cannot contain statements (you couldn’t do a try/except block, or a while loop); they cannot have assignments, or multiple expressions. They don’t feel syntactically as expressive as other functions in Python.
Your composition and curry are OK, and related tools exist in standard libraries. The lack of a first class support is a minor annoyance but not a showstopper, and the solutions are not as natural as genuine pipe notation (you can’t simply write left to right and generate text autoregressively). The lambda limit was more real in my mind and I hope Python eventually corrects it.
No function in functional programming allows more than one statement.
That is literally the definition of FP. That the definition of a functions be a singular statement as opposed to a procedural function is a function made up of several statements where each statement has the potential to assign or reassign values. If you write a function with procedures you are not doing functional programming. That's why python lambdas are defined that way.
That being said python doesn't support the let...in expression which is common to do in fp, but neither does JavaScript.
JavaScript just supports anonymous functions that aren't functional. If you make the procedures const then you get something similar to let in which is arguably a trick to make it work.
You can do tricks in python to achieve the same thing with lambdas. In JavaScript you do tricks to make anonymous functions behave like lambdas with let-in, in python you can also do a trick to get let-in behavior in a lambda.
f = lambda x:(
y := 1,
w := 3,
y + w + x)[-1]
Arguably though you shouldn't do this. The pythonic philosophy is that Any function past a certain level of complexity you should just use def rather then inline it. This philosophy still applies in FP.
Ultimately these are minor syntactic and stylistic differences involving trivial sugar.
I don't think python will "correct it" because from their perspective there is nothing to correct. Make your function a def. That's the pythonic way.
The first class support for for pipe operators and what not are not present in JavaScript or python. It's not showstoppers. But in python it is possible to get composition working with magic method operating overloading. It's just not first class.
Fp in js never involved the algebraic operator style promoted by haskell. In this sense it's more lisp style and python is similar to js in this respect.
> lambda functions in python have as much expressive power as any function.
There is no fundamental reason why Python doesn’t have let, and there is no fundamental reason to not be able to catch exceptions within a lambda. Python already fixed the unneeded print statement in its history so I think there is hope. (I don’t think js is relevant here; I was trying to explain why lispers or people who like Haskell may revisit their improved expressive environments).
Lisp, JavaScript, and Python are all dynamically typed, so I made the suggestion with that apparent preference in mind.
The example is interesting. Here's how I might have done something similar in JavaScript. Currying is part of the JavaScript language, and I composed a list of curried functions using reduce.
const multiply = a => b => a * b
const subtract = b => a => a - b
const quadrupleAndSubtractTwo = a => [multiply(2), multiply(2), subtract(2)].reduce((x, f) => f(x), a)
const quadrupleAndSubtractTwoFromAll = numbers => numbers.map(quadrupleAndSubtractTwo)
> quadrupleAndSubtractTwoFromAll([3, 4, 5, 6, 7])
> [ 10, 14, 18, 22, 26 ]
You didn't implement the fundamental operator of functional programming. Composition of functions. That is the key operation of functional programming.
Reduce map are all available in python as well. Basically your implementation is doable in python as well with the same level of tenseness. The main difference as I said earlier is typescript lacks exhaustive pattern matching and sum types.
But anyway no point in this. Python can match the terseness of JavaScript.
The only reason my implementation was long was because I used types and recursion. Python can have the same terseness as your old style untyped javascript if needed:
remember the reduce function can be built out of recursion. What you see in JS is just a convenience function for reduce, if a language has recursion, reduce can easily be built in one line.
def reduce(f, xs, x):
return x if len(xs) == 0 else reduce(f, xs[1:], f(xs[0], x))
Thus reduce isn't really a "feature".
Python is superior to JS for FP because it can match the expressiveness of JS while adding the additional feature of exhaustive pattern matching and list comprehensions, which JS or TS can't do. This makes JS explicitly inferior.
Recursion in Python suffers from limited utility due to the lack of TCO and the strict (but adjustable) recursion depth limit. JS, for all its problems, at least includes TCO these days. Shame Python has decided to stay on the worse path there.
You're seriously misinformed. All of what you're saying is categorically false on all counts and exhibits fundamental misunderstanding about the topic at hand. You are not just wrong from one perspective, you are wrong from every possible valid perspective conceivable.
First of all the discussion at hand is not the language implementation, the discussion at hand is about the language specification. TCO is a implementation feature, whether the engine/compiler/interpreter implements said feature is irrelevant to the conversation which is about the specification NOT the implementation. So on this count you are wrong. More accurately off topic.
Second there are several python interpreters. The most popular is CPython. CPython does not include TCO deliberately because Guido specified he wanted stack traces at all times for easier debugging. However PYPY which uses a JIT does use TCO. Stackless python another interpreter by it's very name also does something very similar to TCO. So additionally you are completely wrong again from this angle.
Third there are two popular JavaScript engines in use by browsers and nodejs today. V8 and spider monkey. Spider monkey Does not implement TCO. V8 Did implement TCO for a small amount of time, however, this was later removed due to complexities when debugging practical issues. Thus V8/Spidermonkey and therefore Nodejs and Chrome and Firefox do NOT support TCO. Edge supported TCO with chakra but after a shift to V8 edge also no longer supports TCO. So on this count you are wrong again.
Overall to sum up everything here, you are just wrong, wrong, wrong.
The statement still stands, as a language specification python is more superior feature-wise for FP then JS or TS.
> First of all the discussion at hand is not the language implementation, the discussion at hand is about the language specification. TCO is a implementation feature, whether the engine/compiler/interpreter implements said feature is irrelevant to the conversation which is about the specification NOT the implementation. So on this count you are wrong. More accurately off topic.
I was paying for the $20 plan for quite some time and switched to the $7/month Hacker plan a month or two ago as it had everything I needed. Disappointed to see my only option is to pay nothing or $20.
Overall, still love Replit, just unsure if I'll continue paying myself. Not because it's bad, but because I don't' necessarily need it.
i canceled my replit plan maybe a year and half ago. for similar-ish reasons. i loved the initial product (and evangelized of my own free will), not so much later iterations. making good use of replit now required some learning. considering that replit wasn’t a tool in any of my critical paths i didn’t feel the need to make the investment. i miss it though because i used to collaborate with my partner’s sister on her c++ code for her astrophysics work, and it was a huge learning opportunity for me. looking at the current trajectory of github, it looks like it may be a good replacement for replit v1, soon.
Not the author, for me lisp is the only langues I can write in pen and paper, and I can think the code as simple a different mathematical notation, real lisp is little different than that but you can check the code and retry the part that works different than you expected, make me work in different level of abstraction than opp programming.
I'm the author of the linked post. I'm not sure what you're specifically interested in as coming natural, being productive, and giving joy are largely subjective reasons for preferring a language.
For example, I can say in Lisp it's easier for me to start writing and evolving programs which in turn allows me to produce more code than in other languages. As for the joy, it comes in part from the instant gratification of a low friction environment where you can evaluate -- and see running -- anything from an individual atom to a full program.
I'm the author of the linked post and I didn't use ChatGPT or other tools, not even a spell checker. But I'm not a native English speaker and my writing may come across quite differently.
> The other change is my shift of focus back to Lisp, the programming language I love most and know best.
Part of this is that Replit is for people who want to get things done, but are intimidated by JetBrains's IDEs. Lisp is a language nerd's language. So really, you're not the target customer.
> chromeOS lifestyle
Maybe I'm out-of-touch, but I assumed Lisp hackers would be on something beefier. Yes, it's a "linux" laptop, but it'll be an uphill battle. I expected either a Linux Thinkpad or Framework, maybe Mac OS on a Macbook.
I actually looked into ChromeOS for my grandma. She basically just browses the web, uses gmail, and plays Freecell, but the app situation made Freecell a non-starter.
Edit: If I figured out a production app that had legs, I would move it away to save on costs. It's more of a test space for me.