<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>език за програмиране &#8220;Pony&#8221; &#8211; Code Academy</title>
	<atom:link href="https://codeacademy.bg/en/tag/ezik-za-programirane-pony-en/feed/" rel="self" type="application/rss+xml" />
	<link>https://codeacademy.bg/en/</link>
	<description>Professional programming courses in Sofia.</description>
	<lastBuildDate>Tue, 09 Apr 2024 08:08:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>

<image>
	<url>https://codeacademy.bg/wp-content/uploads/2024/01/cropped-favicon-32x32.png</url>
	<title>език за програмиране &#8220;Pony&#8221; &#8211; Code Academy</title>
	<link>https://codeacademy.bg/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Introduction to the programming language &#8220;Pony&#8221;</title>
		<link>https://codeacademy.bg/en/programirane/vyvedenie-v-ezika-za-programirane-pony/</link>
		
		<dc:creator><![CDATA[codeacademy-support]]></dc:creator>
		<pubDate>Mon, 05 Dec 2022 12:36:44 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[език за програмиране “Pony”]]></category>
		<guid isPermaLink="false">https://codeacademy.bg/uncategorized-bg/vyvedenie-v-ezika-za-programirane-pony/</guid>

					<description><![CDATA[What is Pony? You can think of Pony as a combination of Rust (a programming language designed for performance and safety, especially for safe concurrent and memory management) and Erlang (a programming language used to code WhatsApp). It has remarkable features: Type-safe: Protected from type-related errors. Memory-safe: Protected from various software errors and security vulnerabilities [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 400;">What is Pony?</span></p>
<p><span style="font-weight: 400;">You can think of Pony as a combination of Rust (a programming language designed for performance and safety, especially for safe concurrent and memory management) and Erlang (a programming language used to code WhatsApp). It has remarkable features:</span></p>
<p><span style="font-weight: 400;">Type-safe: Protected from type-related errors.</span></p>
<p><span style="font-weight: 400;">Memory-safe: Protected from various software errors and security vulnerabilities when accessing memory.</span></p>
<p><span style="font-weight: 400;">Exception-safe: The code remains in a working state even when exceptions are generated.</span></p>
<p><span style="font-weight: 400;">Data race-free: Avoids data race, a common issue in concurrent programming where multiple tasks access a shared resource without sufficient protection, leading to undefined or unpredictable behavior.</span></p>
<p><span style="font-weight: 400;">Deadlock-free: Prevents a situation where processes are blocked because each process waits for another resource to execute.</span></p>
<p><span style="font-weight: 400;">Additionally, Pony is compiled from its own code and is offered under a BSD license with two clauses.</span></p>
<p><span style="font-weight: 400;">Why Pony?</span></p>
<p><span style="font-weight: 400;">Writing fast, safe, efficient, concurrent programs is not easy with most existing tools. &#8220;Fast, efficient, and highly concurrent&#8221; is an achievable goal, but add &#8220;safe,&#8221; and things become much harder. This is where Pony comes in and makes this task easily achievable.</span></p>
<p><span style="font-weight: 400;">Concurrent Programming</span></p>
<p><span style="font-weight: 400;">Pony simplifies concurrent programming (the simultaneous execution of multiple processes over a period of time). One way it achieves this is by providing a strong opinionated concurrency story. In Pony, all concurrency is achieved through the actor model.</span></p>
<p><span style="font-weight: 400;">The actor model is most famously implemented in Erlang and Akka. The actor model has been around since the 1970s, and the details vary significantly from implementation to implementation. What remains consistent is that all computations are performed by participants communicating via asynchronous messages.</span></p>
<p><span style="font-weight: 400;">Think of the actor model this way: objects in object-oriented programming are state + synchronous methods, while actors are state + asynchronous methods.</span></p>
<p><span style="font-weight: 400;">When an actor receives a message, it executes the corresponding method. This method can operate on state that is only accessible to that actor. The actor model allows us to use mutable state in a concurrency-safe manner. Each actor is single-threaded. Two methods within an actor never execute simultaneously. This means that within a given actor, data updates cannot cause data races or other issues typically associated with threads and mutable state.</span></p>
<p><span style="font-weight: 400;">Fast and Efficient</span></p>
<p><span style="font-weight: 400;">Pony &#8220;actors&#8221; are scheduled with an efficient work-stealing scheduler. There is one Pony scheduler per available processor. Threads refer to the highest level of code executed by the processor, so with many threads, your processor can handle multiple tasks concurrently. The thread-per-core model is part of Pony&#8217;s attempt to collaborate with the processor to work as efficiently as possible. Pony&#8217;s execution time aims to be as cache-friendly as possible. The less your code breaks the processor&#8217;s cache, the better it will perform. Pony aims to help your code work well with the processor&#8217;s cache.</span></p>
<p><span style="font-weight: 400;">In programming, garbage collection is a form of automatic memory management. A special process called the garbage collector periodically frees memory by removing objects that are no longer in use by the application. Stop-the-world is a crucial phase in some garbage collection algorithms for tracking memory. It halts program execution to scan roots of memory and add write barriers.</span></p>
<p><span style="font-weight: 400;">Pony&#8217;s execution time includes a heap per actor, so there&#8217;s no &#8220;stop-the-world&#8221; step during garbage collection.</span></p>
<p><span style="font-weight: 400;">This means that your program is always doing some work. As a result, Pony programs end up with much more consistent performance and predictable latencies.</span></p>
<p><span style="font-weight: 400;">Safe</span></p>
<p><span style="font-weight: 400;">Pony&#8217;s type system introduces a new concept: reference capabilities, making data safety part of the type system. The type system assigns a property, called a type, to each &#8220;term&#8221; (word, phrase, or other set of symbols). The type of each variable in Pony includes information about how the data can be shared among participants. The Pony compiler uses this information to check during compilation whether your code is protected from data races and deadlocks.</span></p>
<p><span style="font-weight: 400;">If this sounds a bit like Rust, it&#8217;s no coincidence. Pony&#8217;s capabilities and Rust&#8217;s Borrow Checker tool provide data safety; they just approach it in different ways and have different trade-offs.</span></p>
<p><span style="font-weight: 400;">Is Pony right for you?</span></p>
<p><span style="font-weight: 400;">Deciding whether to use a new programming language is difficult. You need to weigh the appropriateness of the tool against its immaturity compared to other solutions. So, what is Pony suitable for?</span></p>
<p><span style="font-weight: 400;">Pony might be the right solution if you need to solve a challenging problem with concurrent task execution in coding. Concurrent programming is the reason Pony exists. If you can achieve what you want in a single-threaded Python script, you probably don&#8217;t need Pony. If you have a problem with concurrent programming, you should consider Pony and its powerful type system protected from data races.</span></p>
<p><span style="font-weight: 400;">With this programming language, you&#8217;ll get a compiler that prevents you from introducing concurrency-related errors and execution time, giving you excellent performance results.</span></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
