Questions tagged [dynamic-typing]
Dynamic Typing is a property of a programming language where type checks are performed mostly at run time.
105 questions
0
votes
3
answers
248
views
Is JSON Schema-based runtime validation more practical than static type hints in real-world Python applications?
Question Body
I'm currently developing a Python coding standard for use in enterprise-level internal systems. Our typical use cases include:
API input/output validation
Reading from databases, ...
12
votes
9
answers
6k
views
At what point does using a statically typed language gain more benefit than using a dynamically typed language with optional type declaration? [closed]
In my understanding, the strengths of not using type are flexible and newbie-friendly, and the strengths of using type are easier to debug and reading code. However now you can use types on ...
0
votes
1
answer
316
views
Are there any general purpose visual programming "languages"? [closed]
Lately I've been surveying the programming language landscape and one of the languages I looked at was Pharo, a modern Smalltalk.
Programming using a living system that runs in a virtual machine seems ...
4
votes
5
answers
546
views
Converting Dynamic Typing To Static Programatically
See: Type inference with duck typing - does this work? Why is it not used?
And: General approach for proving decidability/undecidability
Hello, I wanted to ask a theoretical question about type system ...
0
votes
0
answers
102
views
c# class structuring and appropriate coding techniques
I have 2 classes that share some properties
public class SportsUser
{
public string errorCode { get; set; }
//the sportsuser and SportsAdminUser is from a different database hence the long and ...
0
votes
0
answers
339
views
value-based function dispatch
Problem to solve
I have a method parse_doc that should dynamically determine a parsing function to parse document_id based on the value of the document_id string:
# list of files that may have ...
4
votes
4
answers
2k
views
Ahead-of-time compilation to native machine code of dynamically typed languages
It is my understanding that:
It's particularly difficult to compile ahead of time, to efficient native machine code, a dynamically typed language like Python.
Largely as a result of the above, the ...
7
votes
3
answers
470
views
Is checking for unexpected types in dynamic languages in an untyped project necessary?
In statically typed languages or dynamically typed languages that use a type checking system you can guarantee that the input type is the type that you specified in the contract.
However, in ...
1
vote
3
answers
270
views
What are some strategies for eliminating switches in polymorphic dynamic code spread across multiple layers?
Context: design with correlated polymorphic classes
For example, let's consider the following class definitions for representing messages that we would get from some remote service:
class ...
3
votes
2
answers
9k
views
Web API - strong classes or dynamic?
My web api method should return some structured data about my profile. To do it I created the following POCO classes:
public class ProfileInfo
{
public string FirstName { get; set; }
public ...
0
votes
2
answers
940
views
Should I test the aspects that type checking covers?
For example, should I test like this:
// it shouldn't even compile since I'm using a static type-checking
expect(addTen('string')).toThrowError()
when it is already type-checked like this:
function ...
3
votes
2
answers
343
views
What does "a type system [that] has no hierarchy" mean?
I was reading the Go-lang documents and found under the section of Types that Go has no type hierarchy.
What does that mean exactly? Is it like python that types are been checked at run time (...
6
votes
2
answers
7k
views
Can an interpreted statically typed language be considered type safe?
First let me explain what is my understanding of the terms statically typed language and type safety:
Statically typed language: a language that does not allow you to change the type of a variable at ...
31
votes
9
answers
5k
views
Are there any design patterns that are possible only in dynamically typed languages like Python?
I've read a related question Are there any design patterns that are unnecessary in dynamic languages like Python? and remembered this quote on Wikiquote.org
The wonderful thing about dynamic typing ...
26
votes
2
answers
1k
views
What semantic features of Python (and other dynamic languages) contribute to its slowness?
I don't know very well Python. I'm trying to understand more precisely what exact features of dynamic languages (à la Python, Lua, Scheme, Perl, Ruby, ....) are forcing their implementations to be ...
42
votes
5
answers
5k
views
How to avoid typical "dynamic language mistakes"?
I've recently poured a couple of hours into JavaScript because I wanted to benefit from the massive userbase. Doing that I have noticed a pattern that most people attribute to dynamic languages. You ...
1
vote
3
answers
1k
views
Do dynamically typed languages, such as Ruby and JavaScript, do any dynamic type checking?
If we look at the definition of "dynamically-typed programming languages" in Wikipedia, it says:
Programming languages which include dynamic type-checking but not static type-checking are often ...
0
votes
5
answers
284
views
Confusion about data types, compilers, hardware data representation and static vs dynamic typing [closed]
I am trying to understand static vs dynamic typing, but am really struggling to see how everything fits together.
It all starts with data types. As far as I understand, data types are quite abstract ...
4
votes
1
answer
104
views
Methodology for exploring APIs in dynamic languages
As a regular user of Standard ML and, to a lesser extent, Haskell, the following pattern is deeply ingrained into my "instinctive" approach to navigating and learning new APIs:
Understand the types.
...
6
votes
1
answer
578
views
With sufficiently advanced static typing, what are the advantages of dynamic type systems? [closed]
This question appears to be fairly well tread, for example:
Do dynamic typed languages deserve all the criticism?
What is the supposed productivity gain of dynamic typing?
etc.
However, most questions ...
14
votes
3
answers
725
views
Is an Optional/Maybe type useful in dynamic languages?
Optional is useful in an obvious way in a statically typed language, but I'm wondering if it's also useful in dynamic languages. Usually there's no compiler telling you, "hey, you used this Optional&...
16
votes
4
answers
4k
views
Are there programming languages that support both static and dynamic typing? [duplicate]
Being either static or dynamic should be something completely supported in the language. Static vs dynamic shouldn't be something that you have to turn on and off, switching between basically 2 ...
13
votes
3
answers
6k
views
Is it possible to have a dynamically typed language without duck typing? [closed]
This question has been asked here, but received poor answers and didn't clarify the issue. I believe it justifies asking it again.
I understand that you can have duck typing with either dynamically ...
3
votes
4
answers
15k
views
When to not use dynamic in C# [closed]
I'm making a class similar to the following:
public class KeyValue
{
public readonly string key;
public readonly object value;
}
Value could be of any object type as a result of this design.
...
7
votes
7
answers
6k
views
How can a statically typed language support duck typing?
I understand what dynamic and static type systems are, and what duck typing is. But I don't understand how you can have a static language that supports duck typing. To my understanding only a ...