𝗧𝘆𝗽𝗲 𝗪𝗧𝗙 𝗜𝗻𝗳𝗲𝗿𝗲𝗻𝗰𝗲? You know, that “magic” that lets avantgarde-languages like #fsharp or #haskell guess your types without you writing them everywhere — unlike #csharp or #typescript? ——— I’m creating a 𝘃𝗶𝗱𝗲𝗼 𝘀𝗲𝗿𝗶𝗲𝘀 that tears down the mystery and rebuilds it from 𝗳𝗶𝗿𝘀𝘁 𝗽𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲𝘀. 𝗧𝗵𝗲 𝗚𝗼𝗮𝗹: Build a language that’s as clean as Python, but as safe as TypeScript by making 𝘁𝘆𝗽𝗲 𝗶𝗻𝗳𝗲𝗿𝗲𝗻𝗰𝗲 the foundation, not an afterthought. ——— 𝗧𝗵𝗶𝘀 𝗳𝗶𝗿𝘀𝘁 𝗲𝗽𝗶𝘀𝗼𝗱𝗲 𝗰𝗼𝘃𝗲𝗿𝘀: • We invent a small expression-based core syntax that's capable for a lot of different text syntaxes • Why type inference isn’t just a “nice feature” you can bolt on later • How to turn typing rules into data structures (constraints) • The three-phase algorithm that powers our type systems • Interactive visualization of the solver at work (see screenshot) ——— No hand-waving. No “it just works.” We’ll walk through the AST, generate constraints from typing rules, and watch the unification algorithm 𝘀𝗼𝗹𝘃𝗲 𝘁𝗵𝗲 𝗽𝘂𝘇𝘇𝗹𝗲 step-by-step. After the video, you’ll understand the theory 𝗮𝗻𝗱 have working code to play with. Where this will go? We'll see :) ——— If you’ve ever been curious about what happens behind the scenes when your IDE shows you type errors before you even run your code — 𝘁𝗵𝗶𝘀 𝗶𝘀 𝗳𝗼𝗿 𝘆𝗼𝘂. 𝗩𝗶𝗱𝗲𝗼 𝗱𝗿𝗼𝗽𝘀 𝘀𝗼𝗼𝗻. Check out my YT channel. #TypeInference #ProgrammingLanguages #CompilerDesign #TypeSystems #SoftwareEngineering
Ronald S.’s Post
More Relevant Posts
-
Find the Length of Last Word — Problem My today's LeetCode small challenge. Sometimes we miss little things and end up hardcoding a function that already exists,(I am talking about split( ) ). That's exactly what happened while I was solving the Length of Last Word problem, where you are given a string of words and have to find the length of the last word in that string. So, the solution was simple: use the split( ) method in Python , it removes empty spaces ,then just call the len( ) function on the last word of the string. But what I was doing was hardcoding the splitting of the string into words. It’s where Reyan Arshad told me that I have figured out the solution, have you? I said, “Not yet, give me a hint,” and he said, “Here we have to use a method that automatically gives a list of words only, without spaces.” As soon as I read the hint, and specifically the word "method" it clicked — the split( ) method — and the solution was reached. P.S. It’s my second day of LeetCode problem-solving. Here’s my LeetCode profile 👇 https://lnkd.in/daSxpGmi 🔗 Connect if you are also solving LeetCode problems — I’ll be sharing simple explanations of the problem solutions here. #datastructures #algorithms #LeetCode
To view or add a comment, sign in
-
-
Problem: Given a string containing ()[]{}, determine if the parentheses are valid. A string is valid if brackets close in the correct order and type. ⬇️ ⬇️ ⬇️ My initial intuition: 😎 Thought of using a stack immediately — push openings, pop on closings. ☠️ But the first few implementations broke on tricky cases like ([)]. 🤡 I was popping and comparing in the wrong order and couldn’t figure out how to validate the pairings cleanly. ⬇️ ⬇️ ⬇️ After careful debugging: 😎 Discovered that flipping my mapping made the logic much simpler: { ')': '(', ']': '[', '}': '{' } 💡 This way, every closing bracket directly tells me which opening it expects. 😎 The stack now works perfectly — last in, first out — catching even the toughest edge cases. 🌟🌟🌟 learned about little micro optimizations: -> to create a local reference of the map helps with access times. -> not unravelling map with .values() calls, instead created a set of opening parenthesis. ✅ Intuition was right this time. 😅 Execution... not so much. #LeetCode #ProblemSolving #Python #LearningJourney #Coding
To view or add a comment, sign in
-
-
Examples are the best documentation When I'm searching for docs, 95% of the time a single example would suffice. Yet, 95% of the time I can't find one in any official source. Consider this example from the Python 3 docs: max(iterable, /, *, key=None) -> Return the largest item in an iterable or the largest of two or more arguments.... [followed by 5 short paragraphs]. You need to know quite a bit about Python in order to understand this: - What * and / means in the function definition. - What's a "positional-only parameter separator" - What's an iterable. - What are keyword-only arguments. - What key usually means. Then you have to read some text in order to understand what values you can pass and how to actually call the function. This example would've quickly helped : max(4, 6) # → 6 max([1, 2, 3]) # → 3 max(['x', 'y', 'abc'], key=len) # → 'abc' max([]) # ValueError: max() arg is an empty sequence max([], default=5) # → 5 Easy, right? #Documentation #DevExperience #DeveloperTools #CodeExamples #Productivity
To view or add a comment, sign in
-
🚀 It’s never too late to start something new. I hesitated to post this because it’s only four lines of code — and honestly, it still feels like little more than writing print("Hello, World!") four times. I’ve done that more times than I can count, and I’ve even written a few small scripts (with a little help) to automate basic security tasks — like pinging hosts on a network and reporting if they’re up, among a few others. But this time is different. I wanted to make it formal — follow a real learning plan and study Python systematically. I want to build a solid foundation instead of just cobbling things together. This week, I finally stopped saying “someday” and started saying “today.” One of my first programs was a simple Band Name Generator: print("Welcome to the Band Name Generator.") city = input("Which city did you grow up in?\n") pet = input("What is the name of a pet?\n") print("Your band name could be " + city + " " + pet) Sure, it’s only a few lines of code — but those lines represent: Learning how user input works Assigning variables Understanding string concatenation Getting comfortable with program flow It’s small, but it’s a start. And the start is everything. It still feels a bit like using an Easy-Bake Oven instead of cooking from scratch — but what I do today, I’ll know tomorrow, and I’ll build from there. #Python #100DaysOfCode #CareerGrowth #LearningInPublic #Moretofollowsoon.
To view or add a comment, sign in
-
Still juggling loops and swaps to reverse strings? Try the push–pop stack trick instead 🔄 Using a stack to reverse a string? Pure genius! Here's the breakdown that'll blow your mind 💪 Think of it like this - you're literally flipping the script with LIFO (Last In, First Out). Push every character onto your stack, then pop them back out. Boom! Reversed string without breaking a sweat. Check out this Python magic: def reverse_string(s): stack = [] # Push all characters for char in s: stack.append(char) # Pop to create reversed string reversed_str = "" while stack: reversed_str += stack.pop() return reversed_str Sure, it's O(n) time and O(n) space - but here's why this approach is absolutely worth knowing: 🎯 Handling nested structures becomes a breeze 🎯 Perfect for complex parsing where order matters 🎯 Builds that rock-solid algorithmic foundation Now, I know what you're thinking - "But string[::-1] is faster!" And you're right! But understanding the stack method? That's what separates good developers from great ones. It's about building that problem-solving muscle 🧠 Trust me, once you master this pattern, you'll start seeing stack solutions everywhere. Your future self will thank you when you're tackling those tricky interview questions! Drop a 🔥 if this just clicked for you! #DataStructures #Programming #Frontend
To view or add a comment, sign in
-
🚀 DSA Progress – Day 106 ✅ Problem #557: Reverse Words in a String III 🧠 Difficulty: Easy | Topics: String, Two Pointers, In-place Reversal 🔍 Approach: Implemented a two-pointer traversal method to reverse each word in the sentence individually without changing the word order. Step 1 (Conversion): Since Python strings are immutable, first convert the input string into a list to allow in-place modifications. Step 2 (Traversal): Use pointer i to find the start of a word and pointer j to find its end by moving forward until a space or end of the string is found. Step 3 (Reversal): Once the word boundaries (i to j-1) are identified, reverse that portion in place using slicing (s[i:j] = reversed(s[i:j])). Step 4 (Iteration): Continue scanning until the entire sentence is processed. Finally, join the list back into a string and return it. This method ensures that each word’s characters are reversed, while their overall positions remain unchanged in the sentence. 🕒 Time Complexity: O(n) — Each character is visited once. 💾 Space Complexity: O(n) — For the list representation of the string. 📁 File: https://lnkd.in/gdefC89D 📚 Repo: https://lnkd.in/g8Cn-EwH 💡 Learned: This problem reinforced how two-pointer logic and in-place modification can be used to efficiently handle string problems. It also highlighted the importance of mutable vs immutable data types in Python. Breaking the sentence word by word made the logic clean and modular — a good reminder that even simple problems can sharpen control-flow and boundary-handling skills. ✅ Day 106 complete — flipped every word inside out but kept the sentence standing tall! ✨🪞📜 #LeetCode #DSA #Python #Strings #TwoPointers #InPlace #CodingJourney #InterviewPrep #DailyPractice #GitHubJourney
To view or add a comment, sign in
-
🚀 DSA Challenge – Day 101 Problem: Maximum Number of Operations on Binary String ⚙️💡 This problem was an elegant mix of string traversal and logical counting, where understanding the movement of '1's relative to '0's was key to finding the optimal number of operations. 🧠 Problem Summary: You are given a binary string s. You can repeatedly perform the following operation: Choose an index i where s[i] == '1' and s[i + 1] == '0'. Move '1' right until it reaches the end or another '1'. Your goal → Return the maximum number of operations that can be performed. ⚙️ My Approach: 1️⃣ Traverse the string from left to right. 2️⃣ Maintain two counters: ones → counts the number of '1's encountered so far. res → stores the total number of operations. 3️⃣ Every time a '0' is found after some '1's, we can perform operations equal to the number of '1's seen so far. 4️⃣ Continue counting consecutive zeros and repeat the process. 💡 Why This Works: Each '1' can “influence” all the zeros that appear after it — moving right across them. Hence, for every block of zeros, we add all previously counted ones to our result. 📈 Complexity Analysis: Time Complexity: O(n) → Single pass through the string. Space Complexity: O(1) → Constant extra space. ✨ Key Takeaway: Sometimes, all it takes is counting relationships instead of simulating moves — a simple greedy insight leading to an optimal O(n) solution. ⚡ 🔖 #DSA #100DaysOfCode #Day101 #LeetCode #ProblemSolving #GreedyAlgorithm #StringManipulation #Python #CodingChallenge #TechCommunity #EfficientCode #LearnByDoing
To view or add a comment, sign in
-
-
🚀 DSA Challenge – Day 83 Problem: Minimum Possible Length of Original String from Concatenated Anagrams 🔡✨ This was an elegant string manipulation and frequency-matching problem — a beautiful blend of observation and brute-force validation. 🧠 Problem Summary: You are given a string s, known to be a concatenation of anagrams of some original string t. The task is to determine the minimum possible length of t. ✅ Each substring of length len(t) should contain exactly the same frequency of characters. ✅ The string s can thus be divided into equal-length chunks, all being anagrams of t. ✅ The goal is to find the smallest such length that satisfies this property. ⚙️ My Approach: 1️⃣ Iterate through all divisors i of n = len(s) — potential lengths of t. 2️⃣ For each possible i, check if the string can be divided into equal parts where each part has identical character frequencies. 3️⃣ Use hash maps to store frequency counts and compare each block. 4️⃣ Return the smallest i that satisfies the condition. 📈 Complexity: Time: O(n²) → Checking frequency for each valid divisor. Space: O(k) → For storing character counts per block. ✨ Key Takeaway: When tackling anagram-based problems, frequency comparison is your strongest ally. Instead of guessing patterns, rely on structure and repetition to reveal the hidden base string. 🔍 🔖 #DSA #100DaysOfCode #LeetCode #ProblemSolving #StringManipulation #Anagram #Python #CodingChallenge #InterviewPrep #EfficientCode #HashMap #DataStructures #TechCommunity #CodeEveryday #LearningByBuilding
To view or add a comment, sign in
-
-
💡 Day 43 / 100 – Search in Rotated Sorted Array (LeetCode #33) Today’s problem was a twist on the classic binary search — quite literally! The challenge was to find a target element in a rotated sorted array. At first glance, the array looks unsorted, but there’s actually a pattern. By identifying which part of the array is properly sorted at every step, we can still apply binary search logic efficiently — achieving O(log n) time complexity. This problem beautifully blends pattern recognition with logical precision. 🔍 Key Learnings Even when data looks “unsorted,” patterns often exist beneath. Modified binary search can adapt to many problem variations. Understanding midpoint relationships helps in avoiding brute force. 💭 Thought of the Day Adaptability is key — in coding and in life. Just like binary search adjusts to a rotated array, we can adjust to challenges by recognizing the underlying order in the chaos. Clear logic turns confusion into clarity. 🔗 Problem Link: https://lnkd.in/gS8FcbeE #100DaysOfCode #Day43 #LeetCode #Python #BinarySearch #ProblemSolving #Algorithms #CodingChallenge #DataStructures #CodingJourney #PythonProgramming #LogicBuilding #KeepLearning #TechGrowth #Motivation
To view or add a comment, sign in
-
-
🚀 DSA Progress – Day 103 ✅ Problem #472: Concatenated Words 🧠 Difficulty: Hard | Topics: String, DFS, Dynamic Programming, Memoization 🔍 Approach: Implemented a DFS + Memoization strategy to identify all words that can be formed by concatenating two or more other words from the given list. Step 1 (Preparation): Store all words in a set for O(1) lookups. Step 2 (Recursive Checking): For each word, split it into all possible prefix–suffix pairs. If the prefix exists in the set, check if the suffix is either directly in the set or can be recursively formed using other words. Step 3 (Memoization): Use a dictionary (mp) to cache previously computed results to avoid redundant recursive calls. Step 4 (Result Collection): If a word can be formed by concatenation, add it to the result list. 🕒 Time Complexity: O(n × L²) n = number of words L = maximum word length Each word may be split at every position. 💾 Space Complexity: O(n + L) For the word set, recursion stack, and memoization dictionary. 📁 File: https://lnkd.in/gHA3vtD5 📚 Repo: https://lnkd.in/g8Cn-EwH 💡 Learned: This problem taught me how to efficiently combine recursion and memoization for overlapping subproblems. It felt like solving an advanced version of the Word Break problem but applied across an entire list of words. Breaking down the logic into small, reusable parts (isConcat + main loop) made the implementation clean and scalable. ✅ Day 103 complete — pieced together words like a linguistic puzzle master 🧩✨ Every big problem is just smaller words glued smartly together! 💬🔠 #LeetCode #DSA #Python #Recursion #DynamicProgramming #Strings #Memoization #WordProblems #100DaysOfCode #DailyCoding #InterviewPrep #GitHubJourney
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Awesome!